The corresponding homogeneous equation
![(\mathrm d^2y)/(\mathrm dx^2)+y=0](https://img.qammunity.org/2020/formulas/mathematics/middle-school/sf6yz6qyqg6m5e0n3tfn1glnmp77njropr.png)
has characteristic equation
![r^2+1=0](https://img.qammunity.org/2020/formulas/mathematics/middle-school/ohsw8oh2wslw9pcqkrdg8jervv7r9a1bpl.png)
which admits two roots,
, so the characteristic solution is
![y_c=C_1\cos x+C_2\sin x](https://img.qammunity.org/2020/formulas/mathematics/middle-school/7dbxvkpkg4mn6n5ldhbnpsb8pn94rkz3o5.png)
So we know two fundamental solutions,
and
. These two solutions have Wronskian determinant
![W(y_1,y_2)=\begin{vmatrix}\cos x&\sin x\\-\sin x&\cos x\end{vmatrix}=\cos^2x+\sin^2x=1](https://img.qammunity.org/2020/formulas/mathematics/middle-school/1cma0jshgm0seev74x6tjfq60v6b5afjfr.png)
so they are linearly independent.
We use variation of parameters to find a particular solution
, where
![u_1=-\displaystyle\int\sin x(\tan x+3x-1)\,\mathrm dx=-\ln|\sec x+\tan x|-2\sin x+(3x-1)\cos x](https://img.qammunity.org/2020/formulas/mathematics/middle-school/57z5rfcbxv655jiq1ieyckyiy3uupk5khl.png)
![u_2=\displaystyle\int\cos x(\tan x+3x-1)\,\mathrm dx=2\cos x+(3x-1)\sin x](https://img.qammunity.org/2020/formulas/mathematics/middle-school/xojp1rzcxbz0sf3n7tqe1p3ozbztlnpsxx.png)
![\implies y_p=-\cos x\ln|\sec x+\tan x|-2\sin x\cos x+(3x-1)\cos^2x+2\sin x\cos x+(3x-1)\sin^2x](https://img.qammunity.org/2020/formulas/mathematics/middle-school/a617z7s9m6htnnzrg18adxo9rqpxd6bhde.png)
![\implies y_p=-\cos x\ln|\sec x+\tan x|+3x-1](https://img.qammunity.org/2020/formulas/mathematics/middle-school/9slnwf249pk7npypr4ma94wn6mz8tvw2ql.png)
![\implies\boxed+3x-1](https://img.qammunity.org/2020/formulas/mathematics/middle-school/1rauh099j1bcirzqzoxuk4083fkmrdl021.png)