### Author Topic: FE-P3  (Read 1109 times)

#### Victor Ivrii

• Elder Member
• Posts: 2511
• Karma: 0
##### FE-P3
« on: April 11, 2018, 02:36:13 PM »
Solve by the method of separation of variables
\begin{align}
& u_{tt}-   u_{xx}+ 4u =0,\qquad 0<x<\pi , \; t>0,\label{3-1}\\[2pt]
& u (0,t)= u (\pi ,t)=0,\label{3-2}\\[2pt]
& u(x,0)=f(x),\label{3-3}\\[2pt]
& u_t(x,0)=g(x)\label{3-4}\end{align}
with $f(x)=0$    and  $g(x)=x^2-\pi x$.  Write the answer in terms of  Fourier series.

#### Tristan Fraser

• Full Member
• Posts: 30
• Karma: 11
##### Re: FE-P3
« Reply #1 on: April 11, 2018, 05:35:17 PM »
We let $u = X(x)T(t)$
then plug in:

$T''X - X''T + 4XT = 0$

The boundary conditions imply:

$X(0) = X(\pi) = 0$

and

$u(x,0) = f(x)$
$u_t (x,0) = x^2 - \pi x$

Using same strategy as we always do with a separation of variables, divide by u, and move the $-4$ over to the other side.

$\frac{T''}{T} - \frac{X''}{X} = -4$

Since all three terms are constants, set $\frac{X''}{X} = -\lambda$ and $\frac{T''}{T} = -\lambda - 4$

Solving these ODEs:

$X(x) = Acos\sqrt{\lambda x} + B\sin \sqrt{\lambda x}$
and plugging in the conditions for X will imply that $A = 0$
$X(\pi) = B\sin \sqrt{\lambda \pi} = 0$

and in order to have an eigenfunction with a nontrivial solution, $\sqrt{\lambda} \pi = \pi n$ where n is an integer. Therefore eigenfunction of $n^2$.

Finally, for T: (I dropped a minus sign on the exam, see my comment at the bottom)

$T = C\sin\sqrt{\lambda + 4} t + D\cos \sqrt{\lambda + 4}t$ becomes

$T = C\sin\sqrt{n^2 + 4} t + D\cos \sqrt{n^2 + 4}t$

Then our general solution ought to have the form

$u(x,t) = \sum_{n=1}^{\infty}(C_n\sin\sqrt{n^2 + 4} t + D_n\cos \sqrt{n^2 +4}t)\sin(nx)$

Apply the BC of $u(x,0) = 0$

$0 = \sum_{n=1}^{\infty}(C_n\sin\sqrt{n^2 + 4} (0) + D_n\cos \sqrt{n^2 + 4}(0)\sin(nx)$

Second term's coefficient has to be 0 satisfy this BC:

$u_t(x,t) = \sum_{n=1}^{\infty}(\sqrt{n^2+4}(-C_n\cos\sqrt{n^2 + 4}(t) )\sin(nx)$

Then for the last condition:

$x^2 - \pi x = \sum_{n=1}^{\infty}(\sqrt{n^2+4}(-C_n )\sin(nx)$

Now to find the coefficient:

$C_n = \frac{-2}{\pi \sqrt{n^2+4}}\int_{0}^{\pi}\sin(nx)(x^2 - \pi x) dx$

Split this into two integrals,

$\frac{-2}{\pi \sqrt{n^2+4}}(\int_{0}^{\pi}x^2\sin(nx - \int_{0}^{\pi} \sin(nx)\pi x)$

Integrate by parts to get

$= (\frac{-2}{\pi \sqrt{n^2+4}})(\frac{-\pi^2 \cos \pi}{n} - \frac{2}{n^3}(1-\cos(n\pi)) + \frac{\pi^2 \cos \pi n}{n} = \frac{4}{(\pi \sqrt{n^2+4}) n^3}(1-\cos(n\pi))$

Final series:

$u = \sum_{n=1}^{\infty} \frac{8}{(\pi \sqrt{n^2+4}) n^3})\sin(nx)(\cos(\sqrt{n^2+4})t)$

for odd n.

EDIT: After careful revision, I realized I must have dropped a minus sign on the final. The correct solution should be involving (n^2+4) not (n^2-4), and the above steps have been corrected to reflect that:

@Jingxuan and @George, thank you for pointing out my mistake!

« Last Edit: April 11, 2018, 08:21:03 PM by Tristan Fraser »

#### George Lu

• Jr. Member
• Posts: 8
• Karma: 5
##### Re: FE-P3
« Reply #2 on: April 11, 2018, 05:40:16 PM »
Write: $u = X(x)T(t)$ so that the Laplacian becomes $T''X - X''T + 4XT = 0$, giving us $\frac{T''}{T}+4-\frac{X''}{X}=0$, giving us eigenvalue problems in X and T.

Boundary condition (2) divided by T gives $X(0) = X(\pi) = 0$ which implies a periodicity in X, so therefore we can associate a negative eigenvalue to it. So $X''+\lambda_n X = 0$ and $T''+(\lambda_n+4) T=0$. Write $\lambda_n=\omega^2$.

In general, we have $X=A_n \cos (\omega_n x) + B_n \sin (\omega_n x)$. From the boundary condition used above, we can determine that $A_n=0, \omega_n = n$.

Similarly, $T$ has the solution $T=A_n \cos(\sqrt{n^2+4}t) + B_n \sin(\sqrt{n^2+4}t)$, where we can set $A_n = 0$ from boundary condition (3).

Then $u(x,t)=\sum_{n=1}^\infty A_n \sin(\sqrt{n^2+4}t) \sin (n x)$.

Now to apply initial conditions: $u_t(x,0)=\sum_{n=0}^\infty A_n \sqrt{n^2+4} \sin (\omega_n x)=x^2-\pi x$ and substitute: $C_n=A_n \sqrt{n^2+4}$.

Therefore $C_n=\frac{2}{\pi}\int_0^\pi (x^2-\pi x) \sin(nx) dx=\frac{8}{\pi n^3}$ for odd n, $0$ for even n

So $u(x,t)=u(x,t)=\sum_{n=1}^\infty \frac{8}{\pi n^3 \sqrt{n^2+4}} \sin(\sqrt{n^2+4}t) \sin (n x)$ for all n odd

Unfortunately on the final itself, I made a couple minor mistakes such as using 1 instead of 4, and using $\lambda_n$ instead of $\sqrt{\lambda_n}$
« Last Edit: April 11, 2018, 05:57:45 PM by George Lu »

#### Jingxuan Zhang

• Elder Member
• Posts: 106
• Karma: 20
##### Re: FE-P3
« Reply #3 on: April 11, 2018, 07:23:56 PM »
I agree with George. Tristan: but \eqref{3-4}.

#### Victor Ivrii

• Elder Member
• Posts: 2511
• Karma: 0
##### Re: FE-P3
« Reply #4 on: April 13, 2018, 03:07:51 AM »
Missing calculations of the coefficient and the sign is wrong in the end.

Solution
Separating variables $u(x,t)=X(x)T(t)$ we get
\begin{align}
&X''+\lambda X=0,\label{3-5}\\
&X(0)=X(\pi)=0,\label{3-6}\\
&T''+(\lambda+4) T=0.\label{3-7}
\end{align}
Problem (\ref{3-5})--(\ref{3-6}) has solution
$$\lambda_n= n^2,\qquad X_n =\sin (nx),\qquad n=1,2,\ldots$$
and therefore
$$T_n = A_n \cos ((n^2+4)^{1/2}t)+B_n ((n^2+4)^{1/2}t),$$
and $$u =\sum_{n=1}^\infty \Bigl[A_n \cos ((n^2+4)^{1/2}t)+B_n ((n^2+4)^{1/2}t)\Bigr]\sin (nx).$$
Plugging to (\ref{3-3})--(\ref{3-4}) we get
\begin{align*}
&\sum_{n=1}^\infty A_n \sin (nx)=0,\\
&\sum_{n=1}^\infty (n^2+4)^{1/2} B_n  \sin(nx)= x^2-\pi x.
\end{align*}
and therefore $A_n=0$,
\begin{multline*}
(n^2+4)^{1/2} B_n = \frac{2}{\pi} \int_0^\pi (x^2-\pi x) \sin (nx)\,dx=\\
-\frac{2}{\pi n}\int_0^\pi (x^2-\pi x)\,d\cos (nx) =\frac{2}{\pi n}\int_0^\pi (2x-\pi)\cos (nx)\,dx=
\\
\frac{2}{\pi n^2}\int_0^\pi (2x-\pi)\,d\sin (nx)=-\frac{4}{\pi n^2}\int_0^\pi \sin (nx)\,dx =\\
\frac{4}{\pi n^3}\cos(nx)\bigl|_{x=0}^{x=\pi}=\left\{\begin{aligned}
&0 &&n=2m,\\
-&\frac{8}{\pi (2m+1)^3}  &&n=2m+1.
\end{aligned}\right.
\end{multline*}
Then
\begin{equation*}
u(x,t)=-\sum_{m=0}^\infty \frac{8}{(2m+1)^3 \pi\sqrt{(2m+1)^2+4}} \sin((2m+1)x)\sin(\sqrt{(2m+1)^2+4}t).
\end{equation*}

General comment
Typical errors:
* $\sin(\sqrt{n^2{\color{red}-}4} t)$, $\sin(n t)$ and other errors in $T_n(t)$
* Errors in the calculation of $\int_0^\pi (x^2-\pi x) \sin(nx)\,dx$. It is calculated by integration by parts and it is easier not to break it into two, since function $g(x)$ vanishes at $0$ and $\pi$.
* In the end there is one solution, not two separate solutions for even and odd $n$.