# particular solution of $4y''-y= \sin(x)\cdot \cos(x/2)$

So I'm working with a nonhomogeneous second order differential equation:

$$4y''-y=\sin(x)\cos(x/2).$$

I know that the general solution, $y$, equals $y_c + y_p$ where $y_c$ is the general solution to the complementary equation and $y_p$ is any particular solution to the nonhomogeneous equation. I'm struggling a little bit with $y_p$ because I'm not sure what form the particular solution should be.

I know (at least I think I do) that, for example, the general form of the particular solution for $\cos(x/2)$ is:

$$A\sin(x/2) + B\cos(x/2).$$

I also suspect that the general form of the particular solution for $\sin(x) + \cos(x/2)$ is:

$$A\sin(x) + B\cos(x) + C\sin(x/2) + D\cos(x/2).$$

However, I'm completely thrown off track with $\sin(x)\cdot\cos(x/2)$. I'd appreciate any insight on the matter, because frankly, the entire concept is still a little loose in my head.

-
What do you mean by the general form of the particular solution for cos(x/2)? Usually, what is called a solution is a solution of a diffeential equation so you should explain what differential equation you are considering. –  Did Jul 10 '11 at 9:28
Was about to say the same thing... to speak of a solution of a differential equation, you actually need a differential equation. =P –  Patrick Da Silva Jul 10 '11 at 9:32
hope my edit adds a little bit of clarity to my challenge –  Richard B. Jul 10 '11 at 9:35
Wolfram Alpha can solve this for you: calculation Now that you know the result can you think about it again and come up with the right solution? –  Listing Jul 10 '11 at 9:49
It seems you simply need to learn the so-called variation of parameters method. It is competently explained here: en.wikipedia.org/wiki/Variation_of_parameters, see in particular 2.1 Specific second order equation en.wikipedia.org/wiki/… –  Did Jul 10 '11 at 9:52

There's a trig identity, $$\sin A\cos B=(\sin(A+B)+\sin(A-B))/2$$ which if you haven't seen it before you should be able to verify by expanding out $\sin(A+B)$ and $\sin(A-B)$. Now you can use that on your $\sin x\cos(x/2)$ to turn it into something you know how to handle.

-

As said in the comments, please see the following as an introduction to the WP page.

First step: solve the homogenous equation

Here, the homogenous equation is $4y''-y=0$. General solution: $y_h(x)=Au(x)+Bv(x)$ with $u(x)=\mathrm{e}^{x/2}$ and $v(x)=\mathrm{e}^{-x/2}$.

Second step: solve the nonhomogenous equation

The Gods (or your textbook or your teacher or WP) tell you that you should look for the solution as $$y(x)=A(x)u(x)+B(x)v(x).$$ They also tell you that this strange idea will transform your second order differential equation with one unknown $y$ into a first order differential system of two equations with two unknowns $A$ and $B$.

The key word here is first order in first order differential system. This means you will be able to get rid of the second derivatives of $A$ and $B$. To wit, $$y'(x)=(A'(x)u(x)+B'(x)v(x))+(A(x)u'(x)+B(x)v'(x)).$$ As said before, now you impose that the first parenthesis is zero. Then, $$y'(x)=(A(x)u'(x)+B(x)v'(x))'$$ hence $$y'(x)=(A'(x)u'(x)+B'(x)v'(x))+(A(x)u''(x)+B(x)v''(x)).$$ This is a solution of the equation $4y''(x)-y(x)=z(x)$ if and only if $$4(A'(x)u'(x)+B'(x)v'(x))+4(A(x)u''(x)+B(x)v''(x))-(A(x)u(x)+B(x)v(x))=z(x).$$ The fact that $u$ and $v$ solve the homogenous differential equation cancels the $A$ and $B$ terms. You are left with the system $$A'(x)u(x)+B'(x)v(x)=0,\quad 4(A'(x)u'(x)+B'(x)v'(x))=z(x).$$ For every fixed $x$, this is a Cramér system in the unknowns $(A'(x),B'(x))$ hence you can compute them. From here you must integrate separately $A'$ and $B'$. The general solution will be $A(x)=A_0(x)+a$ and $B(x)=B_0(x)+b$ for some specific functions $A_0$ and $B_0$, and finally, $$y(x)=A_0(x)u(x)+B_0(x)v(x)+au(x)+bv(x),$$ where you recognize that $y=y_p+y_h$ where $y_p=A_0u+B_0v$ is a particular solution of the nonhomogenous equation and $y_h=au+bv$ is the general solution of the homogenous equation.

In the case at hand, you can bypass these steps, thanks to the following.

Zeroth sep: the method of undetermined coefficients

Here, you try to guess a suitable $y_p$, based on the form of your function $z$. Trying to guess directly a solution for $z(x)=\sin(x)\cos(x/2)$ might not be so obvious but it happens that $$2z(x)=z_1(x)-z_2(x) \mbox{with}\ z_1(x)=\sin(3x/2)\ \mbox{and}\ z_2(x)=\sin(x/2),$$ hence if you can manage to find particular solutions $y_{p,1}$ and $y_{p,2}$ of $4y''-y=z_1$ and $4y''-y=z_2$, you will know that $y_p=\frac12(y_{p,1}-y_{p,2})$ is allright.

Here is the lucky guess part: if $y$ is precisely of the form of $z_i$, that is, if $y(x)=\sin(ax)$, then $$4y''(x)-y(x)=-(4a^2+1)\sin(ax).$$ Going backwards for $a=3/2$ and $a=1/2$ yields $y_{p,1}$ and $y_{p,2}$ as multiples of $z_1$ and $z_2$ respectively, hence one particular solution $y_p$ is a linear combination of $z_1$ and $z_2$. You are done.

-
Sure $4y''-y$ is not $4y''+y$? This would make everything functions of the cosine and sine, hence the solution would have a simpler expression. –  Did Jul 10 '11 at 10:50
I really appreciate you taking the time to walk me through this. I'm gonna sit down for a couple hours and really try to get this. I wish my textbook was this helpful :) *Edit: Yup, unless it's a typo on the actual handout, the left side of the equation is definitely of the form: 4y"-y Maybe my prof just likes to torture me :) –  Richard B. Jul 10 '11 at 10:58
It seems Richard wanted to do this with the method of undetermined coefficients. But here you tell him itstead how to do it with the method of variation of parameters. Both are valid ways to do it. –  GEdgar Jul 10 '11 at 13:31

To speak of a solution of a differential equation, you actually need a differential equation. I think that what you're trying to say is that cos(x/2) satisfies a differential equation, for instance this one : $$y'' = -\frac y4$$ (from which it is a particular solution) but then the general solution of this differential equation is what you're trying to state. You might notice that the general solution is not some sort of generalization of a function that you already have, but is a set of all solution of some differential equation (which is often written by specifing some parameters).

Hope that helps,

-
I'm dense as heck, so maybe that's why I don't follow. I'm trying to use the method of undetermined coefficients to find a particular solution of the equation 4y''-y=sin(x)cos(x/2). I know that the form of the particular solution is determined from the right side of the equation, and that's what I'm uncertain of. I've never encountered sin(x)*cos(x/2) before... Am I being even the slightest bit clear as to my dilemma? –  Richard B. Jul 10 '11 at 9:50

I think Gerry's idea is a good one.

First, as for the proof of his equality, sure you know this one:

$$\sin (A+B) = \sin A \cos B + \cos A \sin B \ .$$

From which, you deduce

$$\sin (A-B) = \sin A \cos B - \cos A \sin B \ .$$

$$\sin A \cos B = \frac{1}{2} \left( \sin (A+B) + \sin (A-B) \right) \ .$$

$$4y'' -y = \frac{1}{2} \sin \frac{3x}{2} + \frac{1}{2} \sin \frac{x}{2} \ .$$

To what we can safely apply the Laplace transform, obtaining

$$4{\cal L} [y''] - {\cal L}[y] = \frac{1}{2} {\cal L} \left[ \sin \frac{3x}{2} \right] + \frac{1}{2} {\cal L} \left[ \sin \frac{x}{2} \right] \ .$$

That is

$$4 (s^2 Y(s) -sy(0) - y'(0)) - Y(s) = \frac{1}{2} \frac{3/2}{s^2 + 9/4} + \frac{1}{2} \frac{1/2}{s^2 + 1/4} \ ,$$

where $Y(s) = {\cal L}[y]$. Now put $a = y(0)$ and $b= y'(0)$ and solve this equation for $Y(s)$:

\begin{align} Y(s) &= \frac{3}{16} \frac{1}{(s^2 + 9/4)(s-1/2)(s+1/2) } + \frac{1}{8} \frac{1}{(s^2 + 1/4)(s-1/2)(s+1/2) } \\ &{} \qquad + \frac{as+b}{(s-1/2)(s+1/2)} \ . \end{align}

Finally, apply the inverse Laplace transform to both sides in order to obtain the general solution of your differential equation:

\begin{align} y(x) &= \frac{3}{16} {\cal L}^{-1} \left[ \frac{1}{(s^2 + 9/4)(s-1/2)(s+1/2)} \right] \\ &{} \qquad + \frac{1}{8} {\cal L}^{-1} \left[ \frac{1}{(s^2 + 1/4)(s-1/2)(s+1/2) } \right] \\ &{} \qquad + {\cal L}^{-1} \left[ \frac{as+b}{(s-1/2)(s+1/2)} \right] \ . \end{align}

Now is a matter of time and patiente to compute the right hand side. :-)

For instance, you could write

$$\frac{as+b}{(s-1/2)(s+1/2)} = \frac{A}{s-1/2} + \frac{B}{s+1/2}$$

for some constants $A$ and $B$, depending on $a$ and $b$. Hence

\begin{align} {\cal L}^{-1} \left[ \frac{as+b}{(s-1/2)(s+1/2)} \right] &= A {\cal L}^{-1} \left[ \frac{1}{s-1/2} \right] + B {\cal L}^{-1} \left[ \frac{1}{s+1/2} \right] \\ &= A e^{x/2} + B e^{-x/2} \ . \end{align}

In order to find out constants $A$ and $B$, you could do the following:

$$as + b = A\left( s+ \frac{1}{2} \right) + B \left( s-\frac{1}{2} \right) = (A+B)s + \frac{A-B}{2} \ .$$

Hence

$$A = \dfrac{a+2b}{2} \qquad \text{and} \qquad B = \dfrac{a-2b}{2} \ .$$

As for the remaining terms, you could write:

$$\frac{1}{(s^2 + 9/4)(s-1/2)(s+1/2)} = A \frac{s}{s^2 + (3/2)^2} + B \frac{3/2}{s^2 + (3/2)^2} + C \frac{1}{s- 1/2} + D \frac{1}{s+1/2}$$

and

$$\frac{1}{(s^2 + 1/4)(s-1/2)(s+1/2)} = A' \frac{s}{s^2 + (1/2)^2} + B' \frac{1/2}{s^2 + (1/2)^2} + C' \frac{1}{s- 1/2} + D' \frac{1}{s+1/2}$$

for some real constants (that is, not depending on $a$ and $b$ or anything else) $A,B,C,D$ and $A',B',C',D'$, which I let you the pleasure to compute :-) . Applying the inverse Laplace transform everywhere, you'll obtain:

$${\cal L}^{-1} \left[ \frac{1}{(s^2 + 9/4)(s-1/2)(s+1/2)} \right] = A\cos\frac{3x}{2} + B \sin\frac{3x}{2} + Ce^{x/2} + D e^{-x/2}$$

and

$${\cal L}^{-1} \left[ \frac{1}{(s^2 + 1/4)(s-1/2)(s+1/2)} \right] = A'\cos\frac{x}{2} + B' \sin\frac{x}{2} + C'e^{x/2} + D' e^{-x/2}$$

Some last thoughts. Laplace transform is great for different reasons. One of them is that you can trace back through your computations the origin of the terms in your final solution. For instance, if you differential equation had just been the homogeneous one

$$4y'' -y = 0 \ ,$$

then you could get rid of the two first addends in your general solution of the non-homogeneous one. That is, the solution, depending on the initial conditions $y(0)$ and $y'(0)$, would just have been:

$$y(x) = \frac{y(0) +2 y'(0)}{2} e^{x/2} + \frac{y(0)-2y'(0)}{2} e^{-x/2}$$

-
The Laplace transform is great, but I think for this problem it's overkill. I think a solution without it would take half the space of this solution with it. –  Gerry Myerson Jul 11 '11 at 2:51
@Gerry. You're probably right. But, once you know Laplace transform, you don't have to thing any more about linear differential equations of any order: you just put the Laplace "machine" to work for you. :-) –  a.r. Jul 13 '11 at 5:23