Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use the method of undetermined coefficients, but I'm not sure what I should guess for $\cos^2(x)$. I know that you generally want to take the first few derivatives, so:

$f(x) = \cos^2(x)$

$f'(x) = -2\cos(x)\sin(x)$

$f''(x) = -2\cos(2x)$

$f^{(3)}(x) = 4\sin(2x)$

(now repeats between cosine and sine)

Solving the characteristic equation $5r^2+8r+8 = 0$ gives complementary solution $y_g = c_1e^{-4x/5}\sin(\frac{2\sqrt{6}x}{5})+c_2e^{-4x/5}\cos(\frac{2\sqrt{6}x}{5})$. So a reasonable guess may be:

$y_p = A\cos^2(x)+B\cos(x)\sin(x)+C\cos(2x)+D\sin(2x)$

Is this correct? If not, what am I doing wrong?

share|cite|improve this question
up vote 4 down vote accepted

Convert to the exponential form

$$ \cos^{2}(x) = \frac{1}{4} + \frac{1}{4}e^{i2x} + \frac{1}{4}e^{-i2x}\implies y_p=A + Be^{i2x} + Ce^{-i2x}\,.$$

Note that the functions in $y_p$ do not coincide with those in the solution of the homogenous equation

$$ y_h ={\it c_1}\,{{\rm e}^{\frac{1}{5}\, \left( -4+\sqrt {11} \right) x}}+{\it c_2}\,{{\rm e}^{-\frac{1}{5}\, \left( 4+\sqrt {11} \right) x}}.$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.