Solve $y'' + y = \sec^2 x, 0 < x < \frac{\pi}{2}$ The equation: $y'' + y = \sec^2 x, 0 < x < \frac{\pi}{2}$
I can't seem to find $u'/v'$ values. My system of equations is:
$u' \sin x + v'\cos x = 0$
$u' \cos x - v'\sin x  = \sec^2 x$
I believe that $u = ∫\sec xdx$ and $v = ∫\sec x \tan xdx$, but I cannot for the life of me get these equations to solve for those integrations. Any ideas?
Thank you so much in advance.
 A: This is a standard problem for variation of parameters.
$y''+y = 0$ has the solution $y=c_1 cos(x) + c_2 sin(x)$
Let:
$$Y = u(x)cos(x)+v(x)sin(x)$$
$$Y' = u'cos(x)+v'sin(x)-usin(x)+vcos(x)$$
We have an extra degree of freedom, so with that, let:
$$u'cos(x)+v'sin(x) = 0$$
$$Y' = -usin(x)+vcos(x)$$
$$Y'' = -u'sin(x)+v'cos(x)-ucos(x)-vsin(x)$$
plugging this into the differential equation, and using our earlier condition, we get the system:
$$-u'sin(x)+v'cos(x) = sec^2(x)$$
$$u'cos(x)+v'sin(x) = 0$$
$$\begin{bmatrix}
        cos(x) & sin(x)\\
        -sin(x) & cos(x)\\
        \end{bmatrix}
 \begin{bmatrix}
        u'\\
        v'\\
        \end{bmatrix}=
 \begin{bmatrix}
        0\\
        sec^2(x)\\
        \end{bmatrix}$$
$$
 \begin{bmatrix}
        u'\\
        v'\\
        \end{bmatrix}=
\begin{bmatrix}
        cos(x) & -sin(x)\\
        sin(x) & cos(x)\\
        \end{bmatrix}
 \begin{bmatrix}
        0\\
        sec^2(x)\\
        \end{bmatrix}$$
$$u' = -sin(x)sec^2(x) = -tan(x)sec(x)$$
$$v' = sec(x)$$
solving for $u$ is trivial, as it is a well-known integral formula.
$$u = -sec(x)+C_u$$
To solve for $v$, multiply $sec(x)$ by $\frac{sec(x)+tan(x)}{sec(x)+tan(x)}$, and then make the substitution $s = sec(x) + tan(x)$, so that $ds = sec^2(x)dx + sec(x)tan(x)dx$. The integral then becomes trivial to evaluate, with the solution:
$$v = ln(tan(x)+sec(x))+C_v$$
Therefore, the solution to the differential equation is:
$$y = C_1 cos(x) + C_2 sin(x) - (sec(x)+C_3)cos(x) + (ln(tan(x)+sec(x))+C_4)sin(x)$$
