# Getting the coefficients of inhomogeneous PDE using Fourier method

#### Phys pilot

Problem Statement
$$u_t=ku_{xx}+h \; \;\; \; \; 0<x<1 \; \; \,\; t>0$$

$$u(x,0)=u_0(1-\cos{\pi x}) \; \;\; \; \; 0\leq x \leq 1$$

$$u(0,t)=0 \; \;\; \; \; u(1,t)=2u_0 \; \;\; \; \; t\geq0$$
Relevant Equations
$$u(x,t)=-\frac{hx^2}{2k}+\left(2u_0+\frac{h}{2k}\right)x-\frac{4h}{k\pi}e^{-k\pi^2 t}\sin{\pi x}+ \sum_{n=2}^\infty{a_n e^{-kn^2\pi^2 t}\sin{n\pi x}}$$

$$a_n=\frac{2u_0}{n\pi}[1+(-1)^n]+\frac{2u_0n}{(n^2-1)\pi}[1-(-1)^n]+\frac{2h}{k\pi^3 n^3}[(-1)^n-1]$$
Hello, I posted the same in the partial differential equations section but I'm not getting responses and maybe this section is better for help with homework. I have to solve this problem:

$$u_t=ku_{xx}+h \; \;\; \; \; 0<x<1 \; \; \,\; t>0$$
$$u(x,0)=u_0(1-\cos{\pi x}) \; \;\; \; \; 0\leq x \leq 1$$
$$u(0,t)=0 \; \;\; \; \; u(1,t)=2u_0 \; \;\; \; \; t\geq0$$

So I know that I can split the solution in two (I don't know the reason. I would appreciate a short explanation because we introduce a new fucntion depending just on x and because the sum of the both solutions are also a solution):
$$u(x,t)=v(x,t)+U(x)$$

This give us two different problems.
$$kU''(x)+h=0$$
and
$$v_t=kv_{xx}$$
$$\text{I.C}\begin{cases} v(x,0)=u_0(1-\cos{\pi x})-U(x)\end{cases}$$
$$\text{B.C}\begin{cases} v(0,t)=0 \\ v(1,t)=0 \end{cases}$$

First I can sol the U(x) which is giving me:
$$kU''(x)+h=0$$
$$U(x)=-\frac{hx^2}{2k}+\left(2u_0+\frac{h}{2k} \right)x$$

Now I solve the PDE with the new boundary conditions using the separation of variables and I get:
$$X_n(x)=B_n\sin{n\pi x}$$
$$T_n(t)=C_ne^{-kn^2\pi^2 t}$$
$$v(x,t)=\sum_{n=1}^\infty{=a_ne^{-kn^2\pi^2 t}\sin{n\pi x}}$$

If I apply the initial condition:

$$v(x,0)=\sum_{n=1}^\infty{=a_n\sin{n\pi x}}=u_0(1-cos(\pi x))-U(x)$$

So finally the coefficients should be given by the expression:

$$a_n=2\int_0^1 (u_0(1-cos(\pi x))-U(x))\sin(n \pi x)dx$$

But i'm not gettin the supposed solution which is:
$$a_n=\frac{2u_0}{n\pi}[1+(-1)^n]+\frac{2u_0n}{(n^2-1)\pi}[1-(-1)^n]+\frac{2h}{k\pi^3 n^3}[(-1)^n-1]$$

Actually the supposed solution to the problem is:

$$u(x,t)=-\frac{hx^2}{2k}+\left(2u_0+\frac{h}{2k}\right)x-\frac{4h}{k\pi}e^{-k\pi^2 t}\sin{\pi x}+ \sum_{n=2}^\infty{a_n e^{-kn^2\pi^2 t}\sin{n\pi x}}$$
As you can see the expansion series starts at 2 instead of one so how am I supposed to get the term for n=1 because you can not get it from a_n

Related Calculus and Beyond Homework News on Phys.org

#### Orodruin

Staff Emeritus
Homework Helper
Gold Member
2018 Award
I don't know the reason. I would appreciate a short explanation because we introduce a new fucntion depending just on x and because the sum of the both solutions are also a solution
Superposition. You are writing down the solution to an inhomogeneous partial differential equation as the superposition of the stationary state (that does not depend on $t$) and a non-stationary solution. This will allow you to remove the inhomogeneity from the PDE itself at the expense of introducing an inhomogeneity in the initial conditions (which will essentially be the difference between the initial condition and the stationary state).

The term for $n = 1$ is outside of the sum because it takes a somewhat different form (as you can see). Clearly, the way that the integral is evaluated for $n \neq 1$ does not work for $n = 1$ (the denominator of the second term is zero!) so you need to identify why and do the integral for $n = 1$ explicitly as a special case.

#### Phys pilot

Superposition. You are writing down the solution to an inhomogeneous partial differential equation as the superposition of the stationary state (that does not depend on $t$) and a non-stationary solution. This will allow you to remove the inhomogeneity from the PDE itself at the expense of introducing an inhomogeneity in the initial conditions (which will essentially be the difference between the initial condition and the stationary state).

The term for $n = 1$ is outside of the sum because it takes a somewhat different form (as you can see). Clearly, the way that the integral is evaluated for $n \neq 1$ does not work for $n = 1$ (the denominator of the second term is zero!) so you need to identify why and do the integral for $n = 1$ explicitly as a special case.
Yes, for n=1 there is an indetermination in the second term of the coefficient. But what integral I'm supposed to do for n=1? I'm lost there, I don't see how to get the term outside of the sum.

Actually, I don't see clearly why the integral doesn't work for n=1. I mean, I know that doesn't work for 1 because I know the supposed solution of the coefficients but without that hint I couldn't see that.

#### Orodruin

Staff Emeritus
Homework Helper
Gold Member
2018 Award
But what integral I'm supposed to do for n=1? I'm lost there, I don't see how to get the term outside of the sum.

Actually, I don't see clearly why the integral doesn't work for n=1. I mean, I know that doesn't work for 1 because I know the supposed solution of the coefficients but without that hint I couldn't see that.
The same integral, it is just that the integration cannot proceed in the same way as for the other values of n. You should be able to see why if you find out where the $n^2 - 1$ in the denominator comes from.

#### Phys pilot

The same integral, it is just that the integration cannot proceed in the same way as for the other values of n. You should be able to see why if you find out where the $n^2 - 1$ in the denominator comes from.
Ok so I integrated a_1 separately and I got a really similar term $$-4*h/(pi^3k)$$ but the it should be just pi.

The n^2-1 comes from the integration of the cosine. Could you tell me the integral that I am supposed to do? I think I did the right one integrating the expression for a_1 but I'm not sure.
Sorry I'm using my mobile phone and I can not write formulas.
Thanks for the help

Staff Emeritus
Homework Helper
Gold Member
2018 Award

#### Phys pilot

Yes, of course. Now I can write formulas.
So I do this integral:
$$a_n=2\int_0^1 (u_0(1-\cos{n\pi})+\frac{h}{2k}x^2-(2u_0+\frac{h}{2k})x)\sin{n\pi x}dx$$
Which is the sum of the following integrals:
$$\int_0^1 2u_0 \sin{n\pi x}dx=-\frac{2u_0}{n\pi}((-1)^n-1)$$
$$\int_0^1 2u_0\cos{\pi x} \sin{n\pi x}dx=-\frac{2u_0n}{\pi(n^2-1)}((-1)^n+1)$$
The result for the next one is strange:
$$\int_0^1 2\frac{h}´{2k} x^2\sin{n\pi x}dx=\frac{h}{\pi^3kn^3}((2-\pi^2n^2)(-1)^n-2)$$
$$\int_0^1 -2\frac{h}´{2k} x\sin{n\pi x}dx=\frac{h}{\pi k n}(-1)^n$$
$$\int_0^1 -4x\sin{n\pi x}dx=\frac{4u_0}{n\pi}(-1)`^n$$
So the coefficients should be the sum of those all 5 terms, which is not equal to the supposed solutions but I don't really mind at the moment if the procedure is correct. So now I have a_n and I see that for a_1 doesn't work because there is a indetermination in the second term. Integrating the same formula but for n=1 (I doubt here, this is what I understood about what you told me):
$$a_1=2\int_0^1 (u_0(1-\cos{\pi})+\frac{h}{2k}x^2-(2u_0+\frac{h}{2k})x)\sin{\pi x}dx$$
$$a_1=\frac{4u_0}{\pi}+0+\frac{(pi^2-4)h}{pi^3k}-\frac{h}{\pi k}-\frac{4u_0}{\pi}=-\frac{4h}{\pi^3k}$$
Which is very similar but not exactly. I just want to know if the way to solve it is like this. If the integral are not correct I can re do it again. Thanks.

"Getting the coefficients of inhomogeneous PDE using Fourier method"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving