User:EML5526.S11.Team1.HS/HW2

=HW2=

Problem 1
Derive heat problem equation from Lecture Slide


 * {| style="width:100%" border="0"

$$ \frac{\partial}{\partial x}\left(A \left(x\right) k\left(x\right) \frac{\partial u}{\partial x}\right) + f \left(x,t \right) = A \left(x \right) \rho c \frac{\partial u}{\partial t} $$
 * $$\displaystyle (Eq. 2.1) $$
 * }
 * }

Solution
Fig. 1 Shows a bar of cross section A(x), with conductivity k(x), density ρ, specific heat c, with an internal heat source (or sink) f(x,t). In the bar the heat is transferred only by conduction in x direction. The temperature has been called u(x,t)






 * {| style="width:100%" border="0"



The partial differential equation for this problem can be obtained doing an energy balance in an infinitesimal element of the bar. Fig. 2 shows an infinitesimal element of length dx; heat entering the body on the left hand side is $$q\left(x \right)$$ and heat going out the body on the right hand side is $$q \left(x + dx \right)$$

Doing the energy balance we obtain:
 * {| style="width:100%" border="0"

$$ q \left(x \right) A \left(x \right) - q \left(x + dx \right) A \left(x+dx \right) + fdx = \frac{dE}{dt}$$
 * $$\displaystyle (Eq. 2.2) $$
 * }
 * }

Where $$ \frac{dE}{dt}$$ is the change of energy with respect to time which can be calculated in terms of the temperature as:
 * {| style="width:100%" border="0"



$$ \frac{dE}{dt} = A d x \rho c \frac{\partial u}{\partial t} $$
 * $$\displaystyle (Eq. 2.3) $$
 * }
 * }

The heat flow and the cross area at the right hand side of the element can be approximated by:
 * {| style="width:100%" border="0"



$$ q \left(x + dx \right) = q \left(x \right) + \frac{\partial q}{\partial x} dx $$
 * $$\displaystyle (Eq. 2.4) $$
 * }
 * }


 * {| style="width:100%" border="0"

$$ A \left(x + dx \right) = A \left(x \right) + \frac{\partial A}{\partial x} dx $$
 * $$\displaystyle (Eq. 2.5) $$
 * }
 * }

Replacing on Eq.2.2 we obtain:
 * {| style="width:100%" border="0"

$$ qA - \left(q + \frac{\partial q}{\partial x}dx \right)\left(A + \frac{\partial A}{\partial x} dx \right) + fdx = A d x \rho c \frac{\partial u}{\partial x} $$
 * $$\displaystyle (Eq. 2.6) $$
 * }
 * }

Doing the product we get:
 * {| style="width:100%" border="0"

$$ qA - qA - q \frac{\partial A}{\partial x} dx - A \frac{\partial q}{\partial x} dx - \frac{\partial A}{\partial x} dx \frac{\partial q}{\partial x} dx + fdx = A d x \rho c \frac{\partial u}{\partial x} $$
 * $$\displaystyle (Eq. 2.7) $$
 * }
 * }

Neglecting the second order term we have:
 * {| style="width:100%" border="0"

$$ -q \frac{\partial A}{\partial x} dx - A \frac{\partial q}{\partial x} dx + fdx =Adx \rho c \frac{\partial u}{\partial x}$$
 * $$\displaystyle (Eq. 2.8) $$
 * }
 * }

The first two terms in the latter equation are the derivative of a product; therefore:
 * {| style="width:100%" border="0"

$$ - \frac{\partial}{\partial x} \left(Aq \right) dx + fdx = Adx \rho c \frac{\partial u}{\partial x} $$
 * $$\displaystyle (Eq. 2.9) $$
 * }
 * }

Using the Fourier’s law, the heat flow can be expressed as function of temperature. For an unidirectional case we have:
 * {| style="width:100%" border="0"

$$ q\left (x \right) = -k \left(x \right) \frac{\partial u}{\partial x} $$
 * $$\displaystyle (Eq. 2.10) $$
 * }
 * }

Where: k(x) is the conductivity of the material. Replacing equation Eq.2.9 in Eq.2.10 we have:
 * {| style="width:100%" border="0"

$$ \frac{\partial}{\partial x} \left( Ak \frac{\partial u}{\partial x} \right) + f \left(x,t \right) = A \rho c \frac{\partial u}{\partial t} $$
 * $$\displaystyle (Eq. 2.11) $$
 * }
 * }

Problem 4
Show that
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+x} dx = \frac{x^2}{2} - x + ln \left(1+x \right) + k $$
 * $$\displaystyle (Eq. 4.1) $$
 * }
 * }

part 1
Prove that
 * {| style="width:100%" border="0"

$$ \int lnxdx = xlnx -x $$
 * $$\displaystyle (Eq. 4.2) $$
 * }
 * }

In order to integrate by parts we choose $$ f \left(x \right) = lnx $$ and $$ g' \left(x \right) = 1 $$

Now we apply the formulae for integration by parts which is:


 * {| style="width:100%" border="0"

$$ \int f \left( x \right) g' \left( x \right)dx = f \left(x \right) g \left(x \right) - \int g \left(x \right) f' \left(x \right)dx $$
 * $$\displaystyle (Eq. 4.3) $$
 * }
 * }

Where $$ f' \left(x \right) = \frac{1}{x}, g \left(x \right) = x $$

Substituting these values into Eq.4.3 we get:


 * {| style="width:100%" border="0"

$$ \int lnxdx = xlnx - \int \frac{x}{x} dx = xlnx -x $$
 * $$\displaystyle (Eq. 4.4) $$
 * }
 * }

part 2
Prove that
 * {| style="width:100%" border="0"

$$ \int xlnxdx = \frac{1}{2} x^2 \left[lnx - \frac{1}{2} \right] $$
 * $$\displaystyle (Eq. 4.5) $$
 * }
 * }

In order to integrate by parts we choose: $$ f \left(x \right) = lnx $$ and $$ g' \left(x \right) = x $$

Where $$ f' \left(x \right) = \frac{1}{x}, g \left(x \right) = \frac{x^2}{2} $$

Substituting these values into Eq.4.3 we get:


 * {| style="width:100%" border="0"

$$ \int xlnxdx = \frac{x^2}{2} lnx - \int \frac{x^2}{2} \frac{1}{x} dx = \frac{x^2}{2} lnx - \int \frac{x}{2}dx = \frac{x^2}{2} lnx - \frac{x^2}{4} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.6) $$
 * }
 * }

Factoring out $$ \frac{1}{2} x^2 $$ we get:

part 3
Find
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+cx} dx $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.7) $$
 * }
 * }

The integral can also be written as follows:


 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+cx} dx = \frac{1}{c} \int \left[x - \frac{x}{1+cx} \right]dx = \frac{1}{c} \left[\int xdx - \int \frac{x}{1+cx} dx \right] $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.8) $$
 * }
 * }

To solve this integral, we made the next change of variables:
 * {| style="width:100%" border="0"

$$ y = 1+cx \Rightarrow  x = \frac{y-1}{c}  \Rightarrow  dy = cdx $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.9) $$
 * }
 * }

Substituting these values into Eq.4.8 we get:
 * {| style="width:100%" border="0"

$$ \int \frac{ \left(y -1 \right)^2}{c^2 y} \frac{dy}{c} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.10) $$
 * }
 * }

Which can be expanded to:
 * {| style="width:100%" border="0"

$$ \frac{1}{c^3} \int \frac{y^2 - 2y +1}{y} dy = \frac{1}{c^3} \int \left(y -2+ \frac{1}{y} \right) dy = \frac{1}{c^3} \left( \frac{y^2}{2} -2y+lny \right) $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.11) $$
 * }
 * }

Finally, replacing y as a function of x we have:
 * {| style="width:100%" border="0"

$$ \frac{1}{c^3} \left[ \frac{ \left(1+cx \right)^2}{2} - 2 \left(1+cx \right) + ln \left(1+cx \right) \right] $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.12) $$
 * }
 * }

Choosing $$ c = 1 $$
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+x} dx = \frac{x^2}{2} - x - \frac{3}{2} + ln \left(1+x \right) $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.13) $$
 * }
 * }

Wolfram Alpha Proof for Part 3

part4
Find
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{a+bx} dx $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.14) $$
 * }
 * }

We start by changing the variables with:


 * {| style="width:100%" border="0"

$$ y = a +bx \Rightarrow  x = \frac{y - a}{b}  \Rightarrow  dx = \frac{dy}{b}$$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.15) $$
 * }
 * }

Replacing these values into Eq.4.14 we get:


 * {| style="width:100%" border="0"

$$ \int \frac{ \left( y-a \right)^2}{b^2 y} \frac{dy}{b} = \frac{1}{b^3} \int \left(y -2a+ \frac{a^2}{y} \right) dy = \frac{1}{b^3} \left( \frac{y^2}{2} - 2ay+ a^2 ln y \right) $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.16) $$
 * }
 * }

Changing the variables we get:


 * {| style="width:100%" border="0"

$$ \frac{1}{b^3} \left( \frac{ \left(a+bx \right)^2}{2} - 2a \left( a+bx \right) + a^2 ln \left(a+bx \right) \right) $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.17) $$
 * }
 * }

Choosing $$ a = b =1 $$ we have:
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+x} dx = \frac{ \left(1+x \right)^2}{2} - 2 \left(1+x \right) + ln \left(1+x \right) $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.18) $$
 * }
 * }

The result is the same as Eq.4.13

Wolfram Alpha Proof for Part 4

Part 5
Find the exact solution $$ u \left(x \right) $$ for the problem (3) p. 9-2 on Mtg.9

The problem is solving the differential equation:


 * {| style="width:100%" border="0"

$$ \frac{d}{dx} \left[ \left( 2+3x \right) \frac{du}{dx} \right] +5x = 0  \forall x \in \left]0,1 \right[  $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.19) $$
 * }
 * }

With the boundary conditions:


 * {| style="width:100%" border="0"

$$ u \left(1 \right) = 4 ~,~ - \frac{du}{dx} \left(x = 0 \right) = 6 $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.20) $$
 * }
 * }

The differential equation can be written:
 * {| style="width:100%" border="0"

$$ \frac{d}{dx} \left[ \left( 2+3x \right) \frac{du}{dx} \right] = -5x $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.21) $$
 * }
 * }

Now integrate:


 * {| style="width:100%" border="0"

$$ \left[ \left( 2+3x \right) \frac{du}{dx} \right] = -5 \frac{x^2}{2} + k $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.22) $$
 * }
 * }


 * {| style="width:100%" border="0"

$$ \frac{du}{dx}= -2.5 \frac{x^2}{\left(2 +3x \right)} + \frac{k}{\left( 2+3x \right)} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.23) $$
 * }
 * }

Now the solution of $$ u \left( x \right) $$ is:


 * {| style="width:100%" border="0"

$$ u \left( x \right) = -2.5 \int \frac{x^2}{ \left(2+3x \right)} dx + k \int \frac{dx}{ \left(2+3x \right)} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.24) $$
 * }
 * }

The first integral can be solved using Eq.4.17 with  $$  a = 2 ~,~ b=3 $$   and the second integral can be solved


 * {| style="width:100%" border="0"

$$ \int \frac{dx}{ \left(2+3x \right)} = \frac{1}{3} ln \left(2+3x \right) + q $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.25) $$
 * }
 * }

Therefore the total solution is:
 * {| style="width:100%" border="0"

$$ u \left(x \right) = -2.5 \frac{1}{3^3} \left[ \frac{ \left(2+ 3x \right)^2}{2} - 2 \times 2 \left(2+3x \right) + 2^2 ln \left( 2+3x \right) \right] + \frac{k}{3} ln \left(2+3x \right) +q $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.26) $$
 * }
 * }

After simplifying everything we obtain:


 * {| style="width:100%" border="0"

$$ u \left(x \right) = \frac{-5}{12}x^2 + \frac{30}{54}x + pln \left(2+3x \right) + r $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.27) $$
 * }
 * }

Where $$ p $$ and $$ r $$ are constants and can be solved using the boundary conditions (Eq.4.20)


 * {| style="width:100%" border="0"

$$ u \left(1 \right) = 4 = \frac{-5}{12} + \frac{30}{54} + pln \left(5 \right) + r $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.28) $$
 * }
 * }

The derivative of u is:


 * {| style="width:100%" border="0"

$$ \frac{du}{dx} = \frac{-10}{12}x + \frac{30}{54} + \frac{3p}{\left(2+3x \right)} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.29) $$
 * }
 * }

Therefore:


 * {| style="width:100%" border="0"

$$ \frac{du}{dx} \left(x=0 \right) = \frac{30}{54} + \frac{3p}{2} = -6  $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.30) $$
 * }
 * }

Solving for p then gives:
 * {| style="width:100%" border="0"

$$ p = - \frac{118}{27} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.31) $$
 * }
 * }

Replacing p into Eq.4.28 gives:


 * {| style="width:100%" border="0"

$$ r = 10.895 $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.32) $$
 * }
 * }

The complete solution is:


 * {| style="width:100%" border="0"

$$ u \left(x \right) = \frac{-5}{12}x^2 + \frac{30}{54}x - \frac{118}{27} ln \left(2+3x \right) + 10.895  $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.33) $$
 * }
 * }