4) Solve:$\displaystyle \frac{dy}{dx} + y = x$
I don't even know what I'm supposed to do on this one...
please help...I need this for my exam
Since you are given an equation, I imagine you are supposed to find the general solution!
There are two ways to do this:
1) Find an integrating factor. That is, find some function u(x) so that multiplying the equation by u(x) makes the left side an "exact differential"- so that $\displaystyle u(x)\frac{dy}{dx}+ u(x)y= \frac{d(u(x)y)}{dx}$. Using the product rule on the right side of that, $\displaystyle \frac{d(u(x)y)}{dx}= u(x)\frac{dy}{dx}+ \left(\frac{du}{dx}\right)y$ so our requirement on u(x) becomes $\displaystyle u(x)\frac{dy}{dx}+ u(x)y= u(x)\frac{dy}{dx}+ \left(\frac{du}{dx}\right)y$. That means we must have $\displaystyle \frac{du}{dx}y= u(x)y$ or $\displaystyle \frac{du}{dx}= u$, a separable equation for u. It "separates" as $\displaystyle \frac{du}{u}= dx$ which integrates to $\displaystyle ln(u)= x+ C$. Taking exponentials of both sides, $\displaystyle u(x)= C'e^x$. We don't need the general solution so take C'= 1, $\displaystyle u(x)= e^x$.
Now $\displaystyle e^x (\frac{dy}{dx}+ y)= \frac{d(e^xy)}{dx}= xe^x$
integrating the left sides just gives $\displaystyle e^xy$ while we can integrate the right side using "integration by parts": Let u= x, $\displaystyle dv= e^x$ so that du= dx and $\displaystyle v= e^x$. $\displaystyle \int xe^x dx= xe^x- \int e^xdx= xe^x- e^x= e^x(x- 1+ C$. So $\displaystyle e^xy= e^x(x-1)+ C$ and $\displaystyle y= x- 1+ Ce^{-x}$
2) Separate into "homogeneous" and "non-homogeneous" parts. That is, first find the general solution to the "homogeneous" part, $\displaystyle \frac{dy}{dx}+ y= 0$. That is the same as $\displaystyle \frac{dy}{dx}= -y$ which separates to $\displaystyle \frac{dy}{y}= -dx$. Integrating both sides, ln(y)= -x+ C so $\displaystyle y= C' e^{-x}$ where $\displaystyle C'= e^C$.
Now try to find a "specific", single, solution to $\displaystyle \frac{dy}{dx}+ y= x$. Since we are only trying to find a single solution rather than the general solution we can try "guessing". (educated guessing, of course!) Since the right hand side of the equation is "x", try y= Ax+ B. Then $\displaystyle \frac{dy}{dx}= A$ and the equation becomes A+ Ax+ B= x. Since that must be true for all x, taking x= 0, we get A+ B= 0 or B= -A. Replacing B by -A gives Ax= x and, taking x= 1, A= 1 so B= -1. y(x)= x- 1 satisfies the differential equation $\displaystyle \frac{dy}{dx}+ y= x$
Finally, we add the general solution to the homogenous equation to the specific solution to the non-homogeneous equation to get the general solution to the entire equation: $\displaystyle y(x)= C'e^{-x}+ x- 1$ as before.
The second method is easier but requires more theory.