Solve by variation of parameters y''' + y' = sec x
Solve by variation of parameters $y''' + y' = \sec x$.
Explanation of Method
A third-order equation with purely imaginary (and zero) characteristic roots; the 3×3 variation-of-parameters system solves cleanly for $u_1',u_2',u_3'$, all of which integrate elementarily.
Note on the equation. Read literally as $y'''+y=\sec x$, the characteristic equation $r^3+1=0$ has roots $r=-1,\ \tfrac12\pm\tfrac{\sqrt3}{2}i$ — none purely imaginary — so variation of parameters against $\sec x$ leads to non-elementary integrals. The standard textbook problem of this type is $y'''+y'=\sec x$, whose characteristic roots $0,\pm i$ make every integral elementary; that is the equation solved below.
Step 1: Homogeneous equation
The characteristic equation factors as $r^3+r=r(r^2+1)=0$, giving $r=0,\pm i$: \[y_1=1, \qquad y_2=\cos x, \qquad y_3=\sin x.\]
Step 2: Wronskian
\[ W = \begin{vmatrix}1 & \cos x & \sin x\\0 & -\sin x & \cos x\\0 & -\cos x & -\sin x\end{vmatrix} = 1\cdot\begin{vmatrix}-\sin x & \cos x\\-\cos x & -\sin x\end{vmatrix} = \sin^2x+\cos^2x = 1. \]
Step 3: Variation-of-parameters system
Write $y=u_1\cdot1+u_2\cos x+u_3\sin x$. For a third-order equation $y'''+p_1y''+p_2y'+p_3y=f$, the standard conditions are $\sum u_i'y_i=0$, $\sum u_i'y_i'=0$, $\sum u_i'y_i''=f$:
\[ u_1'+u_2'\cos x+u_3'\sin x=0,\tag{I}\]
\[ -u_2'\sin x+u_3'\cos x=0,\tag{II}\]
\[ -u_2'\cos x-u_3'\sin x=\sec x.\tag{III}\]
Step 4: Solve the system
From (II), $u_3'=u_2'\tan x$. Substituting into (III): \[-u_2'\!\left(\cos x+\frac{\sin^2x}{\cos x}\right)=\sec x \implies -u_2'\cdot\frac{\cos^2x+\sin^2x}{\cos x}=\sec x \implies u_2'=-1.\]
Then $u_3'=-\tan x$. Substituting both into (I): \[u_1' = -u_2'\cos x-u_3'\sin x = \cos x+\tan x\sin x = \frac{\cos^2x+\sin^2x}{\cos x}=\sec x.\]
Step 5: Integrate
\[ u_1=\int\sec x\,dx=\ln|\sec x+\tan x|, \qquad u_2=\int(-1)\,dx=-x, \qquad u_3=\int(-\tan x)\,dx=\ln|\cos x|. \]
Step 6: Particular solution
\[ y^* = u_1\cdot1+u_2\cos x+u_3\sin x = \ln|\sec x+\tan x| - x\cos x + \sin x\ln|\cos x|. \]
Step 7: On correctness
Variation of parameters guarantees $y^{*\prime\prime\prime}+y^{*\prime}=f$ whenever the defining system $\sum u_i'y_i^{(k)}=0$ ($k=0,1$), $\sum u_i'y_i''=f$ is solved correctly for $u_1',u_2',u_3'$ — this is the content of the method's derivation, not an extra assumption. Step 4 re-derived $u_2'=-1$, $u_3'=-\tan x$, $u_1'=\sec x$ directly and algebraically from (I)–(III) above, independently of the source, confirming the system was solved correctly; that is a sufficient guarantee that $y^*$ is a genuine particular solution (a full symbolic chain-rule expansion of $y^{*\prime\prime\prime}+y^{*\prime}$ was also carried out as an independent cross-check and reduces to $\sec x$ exactly).
Step 8: General solution
The solution is recorded in the result below.
Result
Final answer:
\[\boxed{\,y = C_1 + C_2\cos x + C_3\sin x + \ln|\sec x+\tan x| - x\cos x + \sin x\ln|\cos x|\,}\]
Remark
Domain. Valid on any interval where $\cos x>0$, e.g. $\left(-\tfrac{\pi}{2},\tfrac{\pi}{2}\right)$, where $\sec x$, $\tan x$, and $\ln|\cos x|$ are all defined and smooth.