Solve the 1st order differential equation: y^(1)+4y=cos(x) with intial condition y(?/3)=1
\(\displaystyle y'(x) + 4y(x) = cos(x)\) can be solved in a number of ways. The simplest involves finding a u(x) such that:
\(\displaystyle \int u(x)y' + 4u(x)y\, dx = 4u(x)y(x)\)
Which basically means that we need to find a \(\displaystyle u(x)\) such that
\(\displaystyle u'(x) = 4u(x)\)
This is because by finding a u(x) to meet the above condition, we also find a u(x) to meet this condition:
\(\displaystyle \frac{d}{dx}(y(x)u(x)) = u(x)y'(x) + 4u(x)y(x)\)
So, let's solve for u(x). If \(\displaystyle u'(x) = 4u(x)\), then \(\displaystyle \frac{u'(x)}{u(x)} = 4\) and therefore:
\(\displaystyle ln(u(x)) = 4x \to u(x) = e^{4x}\)
Returning back to our initial problem \(\displaystyle y'(x) + 4y(x) = cos(x)\), let's multiply both sides by \(\displaystyle e^{4x}\):
\(\displaystyle e^{4x}y'(x) + 4e^{4x}y(x) = e^{4x}cos(x)\)
Now integrating both sides gets us:
\(\displaystyle e^{4x}y(x) = \int e^{4x}cos(x)\, dx \to y(x) = \frac{\int e^{4x}cos(x)\, dx}{e^{4x}}\)
All we need to do now is solve for \(\displaystyle \int e^{4x}cos(x)\, dx\)
This seems difficult until we recall that \(\displaystyle cos(x) = \frac{e^{ix}+e^{-ix}}{2}\) (this can be proved with the taylor series) which gives us an easier integral:
\(\displaystyle \int e^{4x}\frac{e^{ix}+e^{-ix}}{2}\, dx = \frac{1}{2}(\int e^{4x+ix}\, dx + \int e^{4x-ix}\, dx)\)
Since we know that \(\displaystyle \int e^{4x+ix}\, dx = \frac{1}{4+i}e^{4x+ix} = \frac{4-i}{17}e^{4x+ix}\) and \(\displaystyle \int e^{4x-ix}\, dx = \frac{1}{4-i}e^{4x-ix} = \frac{4+i}{17}e^{4x-ix}\), we have the solution to our original integral:
\(\displaystyle \int e^{4x}cos(x)\, dx = \frac{\frac{4-i}{17}e^{4x+ix} + \frac{4+i}{17}e^{4x-ix}}{2} + c\) \(\displaystyle = e^{4x}\frac{4e^{ix} - ie^{ix} + 4e^{-ix} + ie^{-ix}}{2\cdot17} + c = \frac{e^{4x}}{17}(4\frac{e^{ix} + e^{-ix}}{2} + \frac{ie^{-ix}-ie^{ix}}{2}) + c\)
And again if we notice that, from the taylor series, \(\displaystyle cos(x) = \frac{e^{ix}+e^{-ix}}{2}\) and \(\displaystyle sin(x) = \frac{ie^{-ix}-ie^{ix}}{2}\), we see what we actually have here is:
\(\displaystyle \frac{e^{4x}}{17}(4\frac{e^{ix} + e^{-ix}}{2} + \frac{ie^{-ix}-ie^{ix}}{2}) + c = \frac{e^{4x}}{17}(4cos(x) + sin(x)) + c \)
Now we plug that into our equation \(\displaystyle y(x) = \frac{\int e^{4x}cos(x)\, dx}{e^{4x}}\) to get:
\(\displaystyle y(x) = \frac{4cos(x) + sin(x)}{17} + ce^{-4x}\) (notice that \(\displaystyle \frac{1}{17}ce^{-4x} = ce^{-4x}\) because since c is representative of any number, c/17 has no real meaning since c/17 is also any number. It it thus "absorbed" into our unknown constant)
Hope this helped!