# I How do I classify this partial differential equation? Inhomogeneous?

#### Phys pilot

Hello,

I have to solve this second order differential equation. It's like a string vibrating equation but with a constant c:

$$\frac{{\partial^2 u}}{{\partial t^2}}=k\frac{{\partial^2 u}}{{\partial x^2}}+c$$

B.C $$u(0,t)=0$$ $$u(1,t)=2c_0$$ c_0 is also a constant

I.C $$u(x,0)=c_0(1-\cos\pi x)$$

This is new for me and I would like to know how to classify it and maybe some recommended book that includes this because mine doesn't and I think I can not separate variables. I have never seen a equation with a constant and then just one initial condition, they usually give us two.
thank you

Related Differential Equations News on Phys.org

#### andrewkirk

Homework Helper
Gold Member
The presence of a constant makes a linear DE like this inhomogeneous.

Can you solve the equation without the constant?

If so, what happens if you take that solution and add to it a function of only $t$ that, when differentiated twice wrt $t$, gives $c$?

#### pasmith

Homework Helper
The presence of a constant makes a linear DE like this inhomogeneous.

Can you solve the equation without the constant?

If so, what happens if you take that solution and add to it a function of only $t$ that, when differentiated twice wrt $t$, gives $c$?
Probably best to take a function of $x$ which when differentiated twice yields $-c/k$ and satisfies the boundary conditions at 0 and 1, since you can then subtract it from $c_0(1 - \cos(\pi x))$ and expand the difference as a sine series on [0,1] to get the initial conditions for the complimentary functions.

#### Phys pilot

Probably best to take a function of $x$ which when differentiated twice yields $-c/k$ and satisfies the boundary conditions at 0 and 1, since you can then subtract it from $c_0(1 - \cos(\pi x))$ and expand the difference as a sine series on [0,1] to get the initial conditions for the complimentary functions.
The presence of a constant makes a linear DE like this inhomogeneous.

Can you solve the equation without the constant?

If so, what happens if you take that solution and add to it a function of only $t$ that, when differentiated twice wrt $t$, gives $c$?
I'm a little bit lost. So, I have to solve it first without the constant which should be easy. But then? I didn't understand the second part. Thats why I'm looking for a book or pdf solving a case like this. Because I found some that intead of a constant they add a function but then the B.C and I.C are different.

I have another doubt, I think that a u_t I.C is missing right? or can I solve it without it?
thanks, sorry for my english

#### pasmith

Homework Helper
The thing about linear problems, such as this one, is that you can split them up into simpler linear problems which you can already solve. Then you just add the solutions together.

So here the simplest method is to write $$u(x,t) = u_1(x) + u_2(x,t)$$ where $u_1$ satisfies $$0 = k\frac{d^2u_1}{dx^2} + c$$ and $u_2$ satisfies $$\frac{\partial^2 u_2}{\partial t^2} = k \frac{\partial^2 u_2}{\partial x^2}$$ so that the sum $u$ satisfies $$\frac{\partial^2 u}{\partial t^2} = k \frac{\partial^2 u}{\partial x^2} + c$$as required.

Now we need to satisfy the boundary conditions. Our only constraint is on the value of $u_1 + u_2$, so we are free to choose the conditions on $u_1$ to our advantage. My suggestion is to take $u_1(0) = 0$ and $u_1(1) = 2c_0$ so that $u_2(0,t) = u_2(1,t) = 0$. The initial condition on $u_2$ must then be $$u_1(x) + u_2(x,0) = c_0(1 - \cos(\pi x)).$$ Thus we are left with two problems:

(1) Solve $$\frac{d^2u_1}{dx^2} = -c/k$$ subject to $u_1(0) = 0$ and $u_1(1)=2c_0$.

(2) Solve $$\frac{\partial^2 u_2}{\partial t^2} = k \frac{\partial^2 u_2}{\partial x^2}$$ subject to $u_2(0,t) = u_2(1,t) = 0$ and $$u_2(x,0) = c_0(1 - \cos(\pi x)) - u_1(x).$$

Hopfully you know how to solve each of those problems separately.

(There is a missing initial condition on $u_t$. My suggestion is to assume that $u_t(x,0) = 0$.)

Why did I not follow @andrewkirk's suggestion of writing $u(x,t) = u_3(t) + u_4(x,t)$? Because that leaves me with a problem for $u_4$ with boundary conditions $$u_4(0,t) = -u_3(t), \qquad u_4(1,t) = 2c_0 - u_3(t),\qquad u_4(x,0) = c_0(1-\cos(\pi x)) - u_3(0)$$ which is much harder to solve than the problem for $u_2$ above.

#### Phys pilot

The thing about linear problems, such as this one, is that you can split them up into simpler linear problems which you can already solve. Then you just add the solutions together.

So here the simplest method is to write $$u(x,t) = u_1(x) + u_2(x,t)$$ where $u_1$ satisfies $$0 = k\frac{d^2u_1}{dx^2} + c$$ and $u_2$ satisfies $$\frac{\partial^2 u_2}{\partial t^2} = k \frac{\partial^2 u_2}{\partial x^2}$$ so that the sum $u$ satisfies $$\frac{\partial^2 u}{\partial t^2} = k \frac{\partial^2 u}{\partial x^2} + c$$as required.

Now we need to satisfy the boundary conditions. Our only constraint is on the value of $u_1 + u_2$, so we are free to choose the conditions on $u_1$ to our advantage. My suggestion is to take $u_1(0) = 0$ and $u_1(1) = 2c_0$ so that $u_2(0,t) = u_2(1,t) = 0$. The initial condition on $u_2$ must then be $$u_1(x) + u_2(x,0) = c_0(1 - \cos(\pi x)).$$ Thus we are left with two problems:

(1) Solve $$\frac{d^2u_1}{dx^2} = -c/k$$ subject to $u_1(0) = 0$ and $u_1(1)=2c_0$.

(2) Solve $$\frac{\partial^2 u_2}{\partial t^2} = k \frac{\partial^2 u_2}{\partial x^2}$$ subject to $u_2(0,t) = u_2(1,t) = 0$ and $$u_2(x,0) = c_0(1 - \cos(\pi x)) - u_1(x).$$

Hopfully you know how to solve each of those problems separately.

(There is a missing initial condition on $u_t$. My suggestion is to assume that $u_t(x,0) = 0$.)

Why did I not follow @andrewkirk's suggestion of writing $u(x,t) = u_3(t) + u_4(x,t)$? Because that leaves me with a problem for $u_4$ with boundary conditions $$u_4(0,t) = -u_3(t), \qquad u_4(1,t) = 2c_0 - u_3(t),\qquad u_4(x,0) = c_0(1-\cos(\pi x)) - u_3(0)$$ which is much harder to solve than the problem for $u_2$ above.
Thank you. So it's the general solution of the homogeneous equation plus a particular solution.
I will try to solve the problem and post the solution here. Thank you again.

#### Phys pilot

The thing about linear problems, such as this one, is that you can split them up into simpler linear problems which you can already solve. Then you just add the solutions together.

So here the simplest method is to write $$u(x,t) = u_1(x) + u_2(x,t)$$ where $u_1$ satisfies $$0 = k\frac{d^2u_1}{dx^2} + c$$ and $u_2$ satisfies $$\frac{\partial^2 u_2}{\partial t^2} = k \frac{\partial^2 u_2}{\partial x^2}$$ so that the sum $u$ satisfies $$\frac{\partial^2 u}{\partial t^2} = k \frac{\partial^2 u}{\partial x^2} + c$$as required.

Now we need to satisfy the boundary conditions. Our only constraint is on the value of $u_1 + u_2$, so we are free to choose the conditions on $u_1$ to our advantage. My suggestion is to take $u_1(0) = 0$ and $u_1(1) = 2c_0$ so that $u_2(0,t) = u_2(1,t) = 0$. The initial condition on $u_2$ must then be $$u_1(x) + u_2(x,0) = c_0(1 - \cos(\pi x)).$$ Thus we are left with two problems:

(1) Solve $$\frac{d^2u_1}{dx^2} = -c/k$$ subject to $u_1(0) = 0$ and $u_1(1)=2c_0$.

(2) Solve $$\frac{\partial^2 u_2}{\partial t^2} = k \frac{\partial^2 u_2}{\partial x^2}$$ subject to $u_2(0,t) = u_2(1,t) = 0$ and $$u_2(x,0) = c_0(1 - \cos(\pi x)) - u_1(x).$$

Hopfully you know how to solve each of those problems separately.

(There is a missing initial condition on $u_t$. My suggestion is to assume that $u_t(x,0) = 0$.)

Why did I not follow @andrewkirk's suggestion of writing $u(x,t) = u_3(t) + u_4(x,t)$? Because that leaves me with a problem for $u_4$ with boundary conditions $$u_4(0,t) = -u_3(t), \qquad u_4(1,t) = 2c_0 - u_3(t),\qquad u_4(x,0) = c_0(1-\cos(\pi x)) - u_3(0)$$ which is much harder to solve than the problem for $u_2$ above.
Hello again, I had some problems. So when I solve this eq and I apply de boundar conditions y get this solution:
$$\frac{d^2u_1}{dx^2} = -c/k$$
$$u_1(x)=2c_0x+\frac{c}{2k}x-\frac{h}{2k}x^2$$
I'm not sure if I did it correctly.
And when I solve the second eq, which is a typical wave equation I get this solution:
$$T_n(t)=C_n\cos{n \pi \sqrt{k} t}$$
$$X_n(x)=B_n \sin{n \pi x}$$
$$u_2(x,t)= \sum_{n=1}^\infty{} a_n \sin{n \pi x}\cos{n \pi \sqrt{k} t}$$
So when I apply the initial condition
$$u_2(x,0) = c_0(1 - \cos(\pi x)) - u_1(x).$$
I get:
$$u_2(x,0)= \sum_{n=1}^\infty{} a_n \sin{n \pi x}=c_0(1 - \cos(\pi x)) - u_1(x)=c_0(1-2x-\cos{\pi x})+\frac{c}{2k}(x^2-x)=g(x)$$
Which seems impossible to solve in an easy way because doesn't look like a fourier series.

Do you think is right? if so, which is the best method to solve it? thanks

EDIT:
So to calculate the coefficients a_n I deduce that I have to solve this integral:
$$a_n=2\int_0^1 g(x) \sin{n\pi x}$$
But introducing my g(x) is not giving me the supposed solution which apparently is:
$$a_n=\frac{2c_0}{n\pi}[1+(-1)^n]+\frac{2nc_0}{(n^2-1)\pi}[1-(-1)^n]+\frac{2c}{k\pi^3 n^3}[(-1)^n-1]$$

Actually, the solution to the problem is supposed to be:
$$u(x,t)=-\frac{cx^2}{2k}+(2c_0+\frac{c}{2k})x-\frac{4c}{k\pi}e^{-c\pi^2 t}\sin{\pi x}+ \sum_{n=2}^\infty{} a_n e^{-cn^2\pi^2 t}\sin{n\pi x}$$

As you can see, I'm not getting those exponentials of the general solution so I think I have a problem obtaining the function U(x) or/and a problem solving the temporal part of the homogeneous wave equation because I get a cosine. But I can not identify the mistake.

Last edited:

#### Phys pilot

Up please. I'm trying and trying and getting always the same result

#### pasmith

Homework Helper
Is it possible that the PDE is actually $$\frac{\partial u}{\partial t} = k \frac{\partial^2 u}{\partial x^2} + c?$$ That would explain both the absence of an initial condition on $\partial u/\partial t$ and the expansion in terms of $e^{-kn^2 \pi^2t}\sin(n\pi x)$.

Since the fourier coefficients depend only on the initial condition and not the time dependence of the eigenfunctions you still have to determine $a_n$ from $$a_n = 2 \int_0^1 \left( c_0(1 - \cos(\pi x)) - \frac{c}{2k}x(x_0 - x)\right)\,dx$$ (Here $x_0$ is chosen so that $u_1(1) = 2c_0$; the working is simplified if the actual value is not substituted until the final step.)

This involves finding the four separate fourier series for $1$, $x$, $x^2$ and $\cos(\pi x)$.

Last edited:

#### Phys pilot

Is it possible that the PDE is actually $$\frac{\partial u}{\partial t} = k \frac{\partial^2 u}{\partial x^2} + c?$$ That would explain both the absence of an initial condition on $\partial u/\partial t$ and the expansion in terms of $e^{-kn^2 \pi^2t}\sin(n\pi x)$.

Since the fourier coefficients depend only on the initial condition and not the time dependence of the eigenfunctions you still have to determine $a_n$ from $$a_n = 2 \int_0^1 \left( c_0(1 - \cos(\pi x)) - \frac{c}{2k}x(x_0 - x)\right)\,dx$$ (Here $x_0$ is chosen so that $u_1(1) = 2c_0$; the working is simplified if the actual value is not substituted until the final step.)

This involves finding the four separate fourier series for $1$, $x$, $x^2$ and $\cos(\pi x)$.
Yes! apparently there was a mistake on the equation and it's heat equation.
You wrote this:
$$a_n = 2 \int_0^1 \left( c_0(1 - \cos(\pi x)) - \frac{c}{2k}x(x_0 - x)\right)\,dx$$
But it should be:
$$a_n = 2 \int_0^1 \left( c_0(1 - \cos(\pi x)) - \frac{c}{2k}x(x_0 - x)\right) \sin(n\pi x)\,dx$$
right?

When you say that I have to find the separate fourier series you mean that I have to solve 4 integral like these ones:

$$2 \int_0^1 c_0\, \sin(n\pi x) dx$$
$$2 \int_0^1 - \cos(\pi x) \, \sin(n\pi x) dx$$
$$2 \int_0^1 - x_0\frac{c}{2k}x\, \sin(n\pi x) dx$$
$$2 \int_0^1 -\frac{c}{2k}x^2\, \sin(n\pi x) dx$$

And then sum them. Or do I have to calculate the fourier series for $1$, $x$, $x^2$ and $\cos(\pi x)$ and the coefficients $a_0$, $a_n$ and $b_n$. If it is like this I don't understand why.

And also if you realize in the given solution the expansion starts in 2 because $a_n$ is not defined for $a_1$.So how do you get the part of the solution corresponding to $$-\frac{4c}{k\pi}e^{-k \pi^2 t} \sin(\pi x)$$ (which is out of the expansion in the solution).

Sorry for so many questions and thank you again.

Edit:
I don't understand. I keep solving the integrals like this:

$$a_n=2 \int_0^1 c_0\, \sin(n\pi x) dx+2 \int_0^1 -c_0\cos{\pi x}\, \sin(n\pi x) dx +2 \int_0^1 -2c_0x\, \sin(n\pi x) dx+2 \int_0^1 -\frac{c}{2k}x\, \sin(n\pi x) dx + \\2 \int_0^1 \frac{c}{2k}x^2\, \sin(n\pi x) dx$$

Which I understand that it's the solution of the coefficientes but I'm not getting the supposed solution and also my expansion doesn't start at 2

Last edited:

"How do I classify this partial differential equation? Inhomogeneous?"

### 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