I am trying to solve the following: $$ y''+4y=\tan(t). $$

I have used the method of variation of parameters. Currently I am at a point in the equation where I have this: $$u_1= \int \frac{\tan t \cos2t}{2}$$

I am stuck here

  • $\begingroup$ I would edit, but I can't. Please use $\tan{t}$ instead of $tan t$, to make it render as text. $\endgroup$
    – user215048
    Jul 15, 2015 at 20:58

3 Answers 3


$\cos 2t = 2\cos^2 t - 1$ hence

$$\int \frac{\tan t \cos2t}{2} dt = \int \sin t \cos t \ dt - \frac 12 \int \tan t \ dt \\ = \frac 12 \sin^2 t - \frac 12 \ln(\sec t) + C$$ $$ = \frac 12 \left( \sin^2 t + \ln(\cos t) \right) + C$$


Start with the ODE

$$y''+4y=\tan t$$

The homogeneous solutions are $y_1(t)=\sin 2t$ and $\cos 2t$. In the method of variations, we form the particular solution $y_p(t)$ as


where the functions $C_1$ and $C_2$ are given by

$$C_1=-\int \frac{1}{W(t)}y_2(t)\tan t\,dt$$

$$C_2=+\int \frac{1}{W(t)}y_1(t)\tan t\,dt$$

where $W(t)$ is the Wronskian for $y_1$ and $y_2$.

First, the Wronskian is trivially evaluated to be $W=-2$.

Second, we evaluate $C_1$ and $C_2$.

$$\begin{align} C_1&=\frac12 \int \cos 2t\,\tan t\,dt\\\\ &=\frac12 \int (\sin 2t-\tan t)\,dt\\\\ &=-\frac14 \cos 2t+\frac12 \log (\cos t) \end{align}$$

$$\begin{align} C_2&=-\frac12 \int \sin 2t\,\tan t\,dt\\\\ &=- \int \sin^2 t\,dt\\\\ &=-\frac12 t+\frac14 \sin 2t \end{align}$$

Third, we determine $y_p$ as

$$\begin{align} y_p(t)&=\left(-\frac14 \cos 2t+\frac12 \log (\cos t)\right)\sin t+\left(-\frac12 t+\frac14 \sin 2t\right)\cos t\\\\ &=-\frac 12 t\cos 2t+\frac12 \sin 2t \log (\cos t) \end{align}$$

Finally, the total solution to the ODE is

$$\bbox[5px,border:2px solid #C0A000]{y(t)=A\sin 2t+B\cos 2t-\frac 12 t\cos 2t+\frac12 \sin 2t \log (\cos t)}$$


$$\int \frac{1}{2}\cos(2t)\tan(t)dt=\frac{1}{2}\bigg(-\frac{1}{2}\cos(2t)+\ln(\cos(t))\bigg)$$

  • $\begingroup$ The OP has already found the solutions to the homogeneous solutions, hence the $\cos 2t$. $\endgroup$
    – Simon S
    Jul 15, 2015 at 21:27
  • $\begingroup$ Yes, I made an edit $\endgroup$
    – 3SAT
    Jul 15, 2015 at 21:40

You must log in to answer this question.

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