# Finding particular solution to a linear first order ODE

I am given this linear first order ODE: $$\frac{d}{dt} T(t)=k(A(t)-T(t))$$ where $$A(t)=-16\cos (\frac{t}{4})$$

and $$k=0.25$$

So $$T(t)$$ - Rate of heat loss

$$A(t)$$ - Varying ambient temperature

I solved for the homogeneous solution to be: $$B e^{-0.25 t}$$, which is correct.

I am having difficulty trying to solve for the particular solution of this ODE.

I am trying to find a particular solution "form" given that $$A(t)$$ is a cosine function, but I can't seem to find an appropriate form. Also, when i was trying to find a "form" for a particular solution, I noticed that it applies to 2nd order linear ODE's. How can I solve for a particular solution for a First order linear ODE?

Note that all derivatives of $$A(t)$$ are some scalar multiple of $$\cos(t/4)$$ or $$\sin(t/4)$$, so you can guess a particular solution of the form

$$T(t) = c_1\cos(t/4) + c_2\sin(t/4)$$

Plugging this in gives

$$(c_2/4 + kc_1)\cos(t/4) + (-c_1/4 + kc_2)\sin(t/4) = -16k\cos(t/4)$$

Comparing coefficients

\begin{align} c_2/4 + kc_1 &= -16k \\ -c_1/4 + kc_2 &= 0 \end{align}

This allows you to solve for $$c_1$$ and $$c_2$$ in terms of $$k$$. For $$k=1/4$$, you'll get $$c_1=c_2=-8$$

This method is known as "undetermined coefficients" which is generally used for second-order equations, but will also work for ODEs of any order, including this one.

Notice that the cosine is the real part of an imaginary exponential. If we try a solution of the form $$ce^{it/4}$$, we have, ignoring the common factor $$e^{it/4}$$

$$c\frac i4=\frac14\left(-16-c\right),$$

which we can solve for $$c$$. Then the solution is the real part of

$$-\frac{16e^{it/4}}{i+1}.$$

If you are open to other methods, this is actually a linear first-order differential equation: $$T’+kT=-16k\cos\frac{t}{4}$$ so you can solve this using an integrating factor: $$\mu=e^{\int k dt}=e^{kt}$$ Your equation becomes: $$T=e^{-kt}\left(\int e^{kt}(-16k\cos\frac{t}{4})dt+C\right)$$