You will learn the method of variation of parameters, which works for a much wider class of nonhomogeneous equations than undetermined coefficients, including cases where the right-hand side is not a simple polynomial, exponential, or trig function.
we already know the general solution to the homogeneous equation:
yh=C1y1(x)+C2y2(x)
The method of variation of parameters assumes a particular solution of the form
yp=u1(x)y1(x)+u2(x)y2(x)
where u1(x) and u2(x) are functions we need to find. After some calculus and algebra, we arrive at the system:
u1′y1+u2′y2=0u1′y1′+u2′y2′=g(x)
Solving this system using determinants (the Wronskian) gives us u1′ and u2′, which we then integrate.
The visual shows the two homogeneous solutions (blue and green) and the particular solution (orange) constructed by varying their coefficients. The particular solution has a fundamentally different shape than either base solution alone.
Solution:
This is impossible with undetermined coefficients (since sec(2x) isn’t a polynomial, exponential, or trig function). Variation of parameters handles it cleanly with y1=cos2x, y2=sin2x, W=2.
Variation of parameters is the go-to method when the forcing function g(x) is messy. Examples include irregular external forces on a bridge, non-sinusoidal voltage in an electrical circuit, or complicated input signals in control systems and signal processing. It is also the foundation for more advanced techniques in physics (Green’s functions) and engineering.