Question: Use the variation of parameter method to find the general solution of the following differential equation $$(\cos x) y''+(2\sin x) y'-(\cos x) y =0\;\;\;\;,\;\;\;\;0<x<1$$

My Try:

I think the question is wrong, since the right hand side term is 0, so the particular integral will also be zero. Thus, the general solution will be equal to homogenous solution. So, I think no use of using the variation of parameter formulas since $y_p(x)=0$ always. I reduced the equation as in the subject or title and then used integrating factor $$y=(\cos x )z$$ to eliminate the term $y'$ but I got another difficult DE as $z''-2\sec^2xz=0$

Please help with any suggestions or do you think question is correct. Is there a way to solve it ?

  • $\begingroup$ I think variation of parameters is typically used to solve initial value problems. If anything, because $x$ is on a bounded domain, you are trying to solve a boundary value problem, or BVP. To find a general solution, you must be given boundary conditions, i.e. $y(0)$ and $y(1)$. To find a unique solution, you need another condition, like $y'(0)$ for example. The problem statement appears incomplete. $\endgroup$
    – Doug
    Jul 20, 2022 at 16:06
  • $\begingroup$ We do not need boundary conditions, see this tutorial.math.lamar.edu/classes/de/VariationofParameters.aspx $\endgroup$ Jul 20, 2022 at 16:10
  • 1
    $\begingroup$ Fair enough... Perhaps you solve it like an initial value problem, and then just restrict the solution to $0<x<1$? But I see what you mean.. You are really just needing to solve a homogeneous equation... Not sure how VOP comes into play. $\endgroup$
    – Doug
    Jul 20, 2022 at 16:14
  • $\begingroup$ It is not ivp, we need to use techniques in ordinary differential equations theory. Ivp and bvp has some initial or boundary conditions. This is just DE with domain which help us. Like it tells we can divide by cosx both sides since it is not zero in the domain $\endgroup$ Jul 20, 2022 at 16:17
  • $\begingroup$ Another observation: The equation can be written as $(\sin (x)y)' + (\cos (x) y)' = 0$ $\endgroup$ Jul 20, 2022 at 17:00

2 Answers 2


By trial and error, you can show that one of the fundamental solutions is $y_1(x) = c\sin(x)$. Now, Abel's Theorem tells us that the Wronskian of solutions is given by $$W(x) = c\text{exp}\left(-\int 2\tan(x) dx\right) = c\cos^2(x).$$ But, $W$ is also equal to the determinant of the Wronskian matrix: $$W(x) = (\cos(x))y_2(x)-(\sin(x))(y_2)'(x).$$ So, solve the equation $$(\sin(x))(y_2)'(x)-(\cos(x))y_2(x) = \cos^2(x),$$ using VOP (or just integrating factor) to find the other fundamental solution, $y_2(x)$. I find that $y_2(x) = c\sin(x)-x\sin(x)-\cos(x)$. Then, the general solution would be $$y(x) = c_1\sin(x)+c_2(x\sin(x)+\cos(x)).$$

Notice that we do not need to use Abel's theorem. You could also sub in $z(x) = \sin(x)y(x)$ and obtain a first-order equation in the same spirit of what you were trying. This approach is know as Reduction of Order.


Note that $y_1(x)=\sin x$ is one solution of the second order linear ODE $$y''+2\tan x y'-y=0$$ If $y_1$ is one solution of ODE $$y''+P(x)y'+Q(x)y=0.$$ Then the other solution $y_2(x)$ is given as $$y_2=y_1C_2\int \frac{\exp[-\int P(x) dx]}{y_1^2}$$

See Finding one solution of second order DE using another solution using Wronskian So here in this case $$y_2=C_2 \sin x \int \frac{\exp[-2\int \tan x dx]}{\sin^2 x} dx=C_2 \sin x \int \cot^2 x ~dx=C_2 \sin x (-x-\cot x)$$ $$=-C_2(x\sin x+ \cos x)$$

So total solution of the ODE (*) is $$y(x)=C_1\sin x+C_3(x \sin x+\cos x)$$

  • $\begingroup$ You meant sinx at starting ? $\endgroup$ Jul 20, 2022 at 17:18
  • $\begingroup$ Oh! Yes thanks I have corrected it now. $\endgroup$
    – Z Ahmed
    Jul 20, 2022 at 17:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .