2
$\begingroup$

The problem is as follows.

Consider the following linear second-order non-homogeneous ordinary differential equation with constant coefficients $$\frac{d^2y}{dx^2}+y=x\cdot\sin(x),\quad x>0.$$ Find the homogeneous solution and the general solution by any method.

The method of unknown coefficients fails me (assuming $y_p(x)=(Ax+B)\sin(x)+(Cx+D)\cos(x)$). I can solve it using LaPlace transforms, but it's very time consuming. The homogeneous solution is easy ($y_h(x)=c_1\sin(x)+c_2\cos(x)$), but the particular solution is trickier.

What is the preferred method to solve this?

$\endgroup$
  • 2
    $\begingroup$ Why does the method of unknown coefficients fail? $\endgroup$ – John Doe Jan 14 '18 at 2:50
  • $\begingroup$ When I substitute the assumed $y_h$ into the ODE, I get no $x\cdot\sin(x)$ on the LHS. So a nonsense solution. If you want, I'll post the work if I should. $\endgroup$ – Gerald Jan 14 '18 at 2:55
  • 1
    $\begingroup$ No, no need to post the work :) If the solution you get in this way fails, then add a multiple of $x$ to the the $y_p$ terms and try again. (See the two answers below) $\endgroup$ – John Doe Jan 14 '18 at 3:11
7
$\begingroup$

There's a lot of unnecessary guessing in the other answers, so I'll tell you how to exactly pinpoint the correct particular form.


The first thing you should do is try to solve the homogeneous equation, which has the characteristic polynomial $$ r^2 + 1 = 0 $$

whose roots are $r = \pm i$. This gives the natural solution $y_h(x) = c_1 \cos x + c_2 \sin x$


The next step is to classify the inhomogeneous function on the RHS. Note that it contains a factor of $\sin x$, which already solves the homogeneous solution. This is why your original guess fails, because $$ (Ax+B)\sin x + (Cx+D)\cos x = Ax\sin x + Cx\cos x + B\sin x + D\cos x $$

See the last two terms? Those will cancel out when you plug them into the original equation, leaving only the two constants $A$ and $C$. This is troublesome because you don't have enough constants to solve the problem. As you've already seen, the LHS (after plugging in) will not contain any terms proportional to $x\sin x$. This makes the problem unsolvable.


To amend the particular solution, the quick and easy way is to tack on another factor of $x$ throughout the entire expression $$ y_p = (Ax+B)x\sin x + (Cx+D)x\cos x $$

Now this expression will lead to a solution. Note that none of these constants can be left out, as the factor of $x$ in $x\sin x$ requires the particular form to contain the factors $\alpha x + \beta$, in the same way that any factor of $x^n$ in the inhomogeneous function requires the full polynomial of degree $n$

$$ c_0 + c_1 x + c_2 x + \dots + c_nx^n $$

The reason being that the lower powers will appear in the derivative expression, even if the original equation doesn't contain them (same reason why you also need a $\cos x$ in there).

The other answers give particular forms $$ y_h = Ax\sin x + Bx\cos x $$ $$ y_h = (Ax^2 + Bx + C)\sin x + (Dx^2 + Ex + F)\sin x $$ The first of which is identical to your intial guess, which doesn't have enough constants. The second has too many constants (two of which belong to the homogeneous already). These examples give you a feel for how many constants is "just right"


Additional note: The multiplicity of the homogeneous part is also important. If your homogeneous solution is instead something like $$ y_h = c_1\sin x + c_2x\sin x $$

which contains two (linearly independent) factors of $\sin x$. You would need another factor of $x$ to round it out. Then the particular has the form $$ y_p = (Ax+B)x^2\sin x + (Cx+D)x^2\cos x $$

Some people might tell you to gradually tack on one factor of $x$ until you get something that works, but this is extraneous. The power of $x$ you need to pultiply with the particular form is exactly equal to the multiplicity of the root. Knowing this will save you time from having to take derivatives and plugging in over and over again.

$\endgroup$
2
$\begingroup$

We know that $c_1\sin x+c_2\cos x$ is the homogeneous, so there is no need to include this in the particular solution. Take instead $y_p=Ax\sin x+Bx\cos x. $ Then: $$y_p''=(A\sin x+Ax\cos x+B\cos x-Bx\sin x)'\\=2A\cos x-Ax\sin x-2B\sin x-Bx\cos x$$ So $$y_p''+y_p=2A\cos x-2B\sin x\equiv x\sin x$$ So it is clear that this doesn't work, so raise the power: $$y_p=(Ax^2+Bx)\sin x+(Cx^2+Dx)\cos x$$ Then you'll find that $$y_p''+y_p=2(2Ax+B+C)\cos x-2(2Cx+D-A)\sin x$$ Equating coefficients, we see $$2(2Ax+B+C)\equiv 0\implies A=B+C=0\\-2(2Cx+D-A)\equiv x\implies D=A=0,C=-\frac14\implies B=\frac14$$

So $$y_p=\frac14 x(\sin x - x\cos x)$$

$\endgroup$
1
$\begingroup$

If it fails, maybe means that it is not in such format, try to raise the power of the polynomials:

$$y_p(x) = (Ax^2 + Bx + C)\sin(x) + (Dx^2 + Ex + F)\cos(x)$$

Then: $$y'' + y =$$ $$(-Ax^2 - (B +4D)x -C -2E+2A)\sin(x) + $$ $$(-Dx^2 + (4A-E)x + 2B+2D-F)\cos(x) +$$ $$(Ax^2 + Bx + C)\sin(x) + (Dx^2+Ex+F)\cos(x)$$ $$=(-4Dx-2E+2A)\sin(x) + (4Ax+2B+2D)\cos(x)=x\sin(x)$$

Thus

$$A=0;B+D=0;A-E=0;-4D=1$$ We get: $$D=-\frac{1}{4};B=\frac{1}{4};A=E=0$$ We could take: $$y_p(x)=-\frac{1}{4}x^2\cos(x) + \frac{1}{4}x\sin(x)$$

EDIT

Per above, constant $C,F$ are cancelled out; this is because they are part of homogeneous solution already (thanks @Dylan for pointing this out)

$\endgroup$
  • $\begingroup$ The constants $C$ and $F$ are extraneous since they are part of the homogeneous solution already. It's not about the polynomial either. All it is is you're adding on another factor of $x$ to get $$y_p = (Ax+B)x\cos x + (Cx+D)x\sin x$$ $\endgroup$ – Dylan Jan 14 '18 at 3:01
  • $\begingroup$ Yea, thanks for pointing out! $\endgroup$ – Yujie Zha Jan 14 '18 at 3:08
0
$\begingroup$

With equations like $$y''+\omega^{2}y=f(x)$$ The following method is usually cool. It is easy to see that this equation can be written as $$\frac{d}{dx}(y'+i\omega{y})-i\omega(y'+i\omega{y})=f(x)$$ Thus, by letting $\xi(x)=y'+i\omega{y}$, you have a first order ode for $\xi$ $$\xi'-i\omega\xi=f(x)$$ Such an equation may be solved in an elementary way by integration factor. However, such a solution will involve evaluation of $2$ integrals. If you think that this is time consuming, use the method of Green's functions.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.