0
$\begingroup$

I am given the equation $$ y''+y = x\cos x - \cos x $$ with initial values of $$y(0)=1, y'(0)= 1/4,$$and I believe this needs to be solved using the method of variation of parameters, though I'm unsure, because after solving the characteristic equation $$m^2+1 =0$$ $$m = -i, i$$ I'm left with $$y_h = C_1\sin x + C_2\cos x,$$and I'm not sure where to move forward from there. I tried taking the Wronskian ($W=1$), and finding $W_1, W_2$ but I'm getting stuck on extremely long integrals to find $u_1, u_2$.

Any help for next steps or an alternative method would be greatly appreciated.

$\endgroup$
  • $\begingroup$ You could also use the methods of undetermined coefficients; have you seen this? $\endgroup$ – StackTD Apr 2 at 8:29
  • $\begingroup$ @Robert Schwartz. See the continuation of your solving (with the Wronskian) in my answer below. $\endgroup$ – JJacquelin Apr 2 at 10:40
2
$\begingroup$

I believe this needs to be solved using the method of variation of parameters, though I'm unsure, (...) but I'm getting stuck on extremely long integrals

Any help for next steps or an alternative method would be greatly appreciated.

Alternatively, using the method of undetermined coefficients, you would propose a particular solution of the form: $$y_p=(Ax+B)\sin x + (Cx+D)\cos x$$ but since (a part of) this solution is already contained in the homogeneous solution, you alter this to: $$\begin{align}y_p & =(Ax+B)\color{red}{x}\sin x + (Cx+D)\color{red}{x}\cos x \\ & =(Ax^2+Bx)\sin x + (Cx^2+Dx)\cos x \end{align}$$ Substitution of this proposed particular solution into the differential equation leads to a linear system of four equations in the four unknowns $A,B,C,D$; no messy integrals.

$\endgroup$
  • $\begingroup$ Once I have the particular solution $y_p$, what should my next steps be for solving the equation with the initial values? $\endgroup$ – Robert Schwartz Apr 2 at 9:01
  • $\begingroup$ Use the initial values to determine the $C_1$ and $C_2$ of the homogeneous solution; it doesn't matter how you found a particular solution. $\endgroup$ – StackTD Apr 2 at 9:03
  • $\begingroup$ I ended up solving for $y_g=y_h+y_p=(1/4x-1/2)xsinx-(1/4)xcosx+cosx+(1/4)sinx$ $\endgroup$ – Robert Schwartz Apr 2 at 9:23
  • $\begingroup$ In the part of the particular solution, you should get $\tfrac{1}{4}x\cos x$ (without the minus) and that would cause the $\tfrac{1}{4}\sin x$ to disappear. $\endgroup$ – StackTD Apr 2 at 9:27
1
$\begingroup$

$$y ″ + y = (x-1)\cos(x) $$

They are several methods to solve it.

The method of variation of parameters (involving Wronskian) is not the simplest in the present case. Nevertheless, since it is the method that the OP want, we will use this method.

Solving the associated homogeneous equation $y ″ + y = 0$ leads to the two linearly independent solutions $u_1=\sin(x)$ and $u_2=\cos(x)$ .

The Wronskian of these two functions is $$W=\left|\left|\begin{matrix} \sin(x) & \cos(x) \\ \cos(x) & -\sin(x) \\ \end{matrix}\right|\right|=-1$$ The solution of the non-homogeneous ODE is on the form : $$y(x)=A(x)u_1(x)+B(x)u_2(x)$$ With $R(x)=(x-1)\cos(x)$ the non-homogeneous term. $$A(x)=-\int \frac{1}{W}u_2(x) R(x)dx=\int (x-1)\cos^2(x)dx$$ $$B(x)=\int \frac{1}{W}u_1(x) R(x)dx=-\int (x-1)\cos(x)\sin(x)dx$$ $$A(x)= \frac14 x^2-\frac12 x-\frac12(x-1)\sin(x)\cos(x)+\frac14 \cos^2(x)+C_1$$ $$B(x)=\frac14 x-\frac12(x-1)\cos^2(x)-\frac14\sin(x)\cos(x)+C_2$$ $y(x)=\left(\frac14 x^2-\frac12 x-\frac12(x-1)\sin(x)\cos(x)+\frac14 \cos^2(x)+C_1 \right)\sin(x)+\left(\frac14 x-\frac12(x-1)\cos^2(x)-\frac14\sin(x)\cos(x)+C_2 \right)\cos(x)$

After simplification : $$\boxed{y(x)=C_1\sin(x)+C'_2\cos(x)+\frac14 x^2\sin(x)-\frac12 x\sin(x)+\frac14 x\cos(x)}$$ $C'_2=C_2-\frac12$

$\endgroup$
0
$\begingroup$

Your equation is of the form $(D^2+1) y = x \cos x - \cos x$. If you apply the differential operator $(D^2+1)^2$, you get the equation $(D^2+1)^3 y = 0$, that has the solution $y = (ax^2+bx+c) \cos x + (dx^2+e x + f)\sin x$. This indicates that a particular solution can take the form $y_p = (ax^2+bx) \cos x + (d x^2 + e x)\sin x$. Plugging the function into the equation you can compute the coefficients and get $$ y_p(x)=\frac 14 x \cos x + (\frac 14 x^2-\frac 12 x) \sin x $$

The general solution is then given by

$$ y(x)=y_h(x)+y_p(x) $$

$\endgroup$
0
$\begingroup$

We have that

$$ y = y_h + y_p $$

with

$$ y_h = c_1 \cos x+c_2 \sin x $$

Making $y_p = c_1(x) \cos x+c_2(x) \sin x$ and substituting into the particular we have

$$ (c_1''(x)+2c_2'(x)-x+1)\cos x+(c_2''(x)-2c_1'(x))\sin x = 0 $$

then choosing $c_1(x), c_2(x)$ such that

$$ c_1''(x)+2c_2'(x)-x+1 = 0\\ c_2''(x)-2c_1'(x) = 0 $$

and after solving for $c_1(x), c_2(x)$ we have

$$ y = (c_1 + c_1(x))\cos x+(c_2 + c_2(x))\sin x $$

NOTE

This kind of problem can be easily solved with the help of the Laplace transform.

$\endgroup$
0
$\begingroup$

Trying to find the solution by variation of parameters one proceeds with the parametrization of the general solution as $$ y(x)=c_1(x)\cos(x)+c_2(x)\sin(x). $$ In the first derivative one fixes the relation between $c_1$ and $c_2$ by demanding

$$ c_1'(x)\cos(x)+c_2'(x)\sin(x)=0 $$

The remaining terms of the first derivative are $$ y'(x)=-c_1(x)\sin(x)+c_2(x)\cos(x). $$ Then insert the second derivative into the ODE which gives

$$ -c_1'(x)\sin(x)+c_2'(x)\cos(x)=(x-1)\cos(x). $$

Now isolating the derivatives can be done via the trigonometric identity $\cos^2(x)+\sin^2(x)=1$ to find \begin{align} c_1'(x)&=-(x-1)\cos(x)\sin(x),\\ c_2'(x)&=(x-1)\cos^2(x). \end{align} This can now be integrated via the double-angle identities and partial integration.

Another way to look at this is to write the linear system in matrix form $$ \pmatrix{\cos x&\sin x\\-\sin x&\cos x} \pmatrix{c_1'(x)\\c_2'(x)} = \pmatrix{0\\(x-1)\cos x} $$ where the system matrix can be identified with the Wronski-matrix of the fundamental system $(\cos x, \sin x)$. The Wronskian determinant is $1$, so that solving the system proceeds by multiplying with the transpose matrix, giving the same derivatives.

$\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.