Solution (source code)

= Solution

Use <variation of parameters>, writing $y_p=t_1u_1+t_2u_2$ and imposing $t_1'u_1+t_2'u_2=0$. <Differentiation> then gives $y_p'=t_1u_1'+t_2u_2'$. Since the $u_j$ solve the homogeneous equation,
$$
L(y_p)=t_1'u_1'+t_2'u_2'.
$$
Thus solve the two-by-two <linear system>
$$
\begin{pmatrix}u_1&u_2\\u_1'&u_2'\end{pmatrix}
\begin{pmatrix}t_1'\\t_2'\end{pmatrix}
=\begin{pmatrix}0\\R\end{pmatrix}.
$$
Its <determinant> is the nonzero <Wronskian> $W$. <Cramer's rule> gives $t_1'=-u_2R/W$ and $t_2'=u_1R/W$, and <integration> gives the stated antiderivatives. Their <integration> constants only add homogeneous solutions. The construction applies on a regular interval where the forcing and coefficients are defined and $W\ne0$.