the variation-of-parameters Wronskian formulas
/ VRON-skee-an /
Variation of parameters comes with two ready-made formulas so you do not have to rederive it each time. They tell you, directly, the derivatives of the two varying functions u1 and u2 in terms of the homogeneous solutions and the forcing. Once you trust them, the method becomes almost mechanical: compute the Wronskian, plug in, integrate.
Start from the standard form y'' + p(x) y' + q(x) y = g(x) (leading coefficient 1) with a fundamental set y1, y2. The Wronskian is W(x) = y1 y2' - y2 y1', a function that measures the independence of y1 and y2 and is never zero on the interval of interest. The formulas are u1' = -y2 g / W and u2' = y1 g / W. You integrate to get u1 and u2 (constants of integration can be dropped, since they only add multiples of y1, y2 already in y_c), and the particular solution is y_p = u1 y1 + u2 y2. Many books fold the integrals into a single integral formula, y_p(x) = integral of [ (y2(t) y1(x) - y1(t) y2(x)) / W(t) ] g(t) dt, which is the same thing written out.
Two safeguards keep these formulas correct. First, the equation must be in standard form with leading coefficient 1 — if the coefficient of y'' is not 1, divide first, because g in the formulas means the right side AFTER that division. Second, W must be the Wronskian of a genuine fundamental set (linearly independent solutions), so W is nonzero; that nonvanishing is what lets you divide by it. With those in place, the formulas are exact and require no guessing about the shape of g.
For y'' - 2y' + y = e^(x)/x with y1 = e^(x), y2 = x e^(x): W = e^(x)(x e^(x) + e^(x)) - x e^(x) e^(x) = e^(2x). Then u1' = -x e^(x) (e^(x)/x)/e^(2x) = -1 and u2' = e^(x)(e^(x)/x)/e^(2x) = 1/x, giving u1 = -x, u2 = ln|x|, so y_p = -x e^(x) + x e^(x) ln|x|.
Compute W, divide, integrate: u1' = -y2 g / W and u2' = y1 g / W.
Mind the minus sign and the pairing: it is u1' = -y2 g / W (the SECOND solution, with a minus) and u2' = +y1 g / W (the FIRST solution); swapping them silently is a classic sign error.