1. ## Differential Equation

How do I find the general solution for this differential equation:
$\displaystyle \frac{dy}{dx} = 2y - 4x$
?

I know how to do them using separation of variables, but I can't figure out this one, because the y and x terms are subtracted rather than multiplied or divided.

Thanks.

2. I do not believe it can be separated... Do you not know how to use Integration Factors to solve for Linear DE's?

3. Doesn't sound familiar. Could you show me the work or point me to a link that explains it?

4. An "integrating factor" for the first order d.e. $\displaystyle \frac{dy}{dx}+ f(x)y= g(x)$ is a function of x, say v(x), such that multiplying the entire equation by it makes the left side an "exact derivative".

That is, multiplying by v(x), to get $\displaystyle v(x)\frac{dy}{dx}+ v(x)f(x)y= v(x)g(x)$ reduces to $\displaystyle \frac{d(v(x)y)}{dx}= v(x)g(x)$.

Of course, by the chain rule, we have $\displaystyle \frac{d(v((x)y)}{dx}$$\displaystyle = v(x)\frac{dy}{dx}+ \frac{dv}{dx}y$. In order that those be equal we must have $\displaystyle v(x)\frac{dy}{dx}+ \frac{dv}{dx}y= v(x)\frac{dy}{dx}+ v(x)f(x)y$ which leads immediately to $\displaystyle \frac{dv}{dx}= v(x)f(x)$ which is a separable d.e.: $\displaystyle \frac{dv}{v}= f(x)dx$ and $\displaystyle ln(v(x))= \int f(x) dx$ so $\displaystyle v(x)= e^{\int f(x)dx}$.

Here, $\displaystyle \frac{dy}{dx}- 2y= -4x$ so f(x)= -2 and $\displaystyle v(x)= e^{-2x}$. Multiplying the equation by that gives $\displaystyle e^{-2x}\frac{dy}{dx}- 2e^{-2x}y= -4xe^{-2x}$

But it is easy to see that $\displaystyle e^{-2x}\frac{dy}{dx}- 2e^{-2x}y= \frac{d(e^{-2x}y)}{dx}= -4xe^{-2x}$.

Integrating, $\displaystyle e^{-2x}y= -4\int xe^{-2x}dx$.

Use "integration by parts" to integrate that.

5. Well, this is a linear differential equation of the first order (meaning it involves only the first derivative). Now, we can move the y term on the right side of the equation to the left side of the equation, like so:

$\displaystyle y' - 2y = -4x$

This is what is called general form, also given by:

$\displaystyle y' + p(x)y = q(x)$

Where p(x) and q(x) can be anything as long as it is a function of x. In our case, p(x) = -2 and q(x) = -4x.

Now, we want a function, we'll call it $\displaystyle u(x)$ such that it makes this equation solvable by integration... So, we multiply everything by it...

$\displaystyle u(x)y'(x) + u(x)p(x)y(x) = u(x)q(x)$

Now, this step isn't really easy to follow, but let's suppose we let:

$\displaystyle u'(x) = u(x)p(x)$

This is just saying that the derivative of u(x) is the product of two functions, one of which is u(x). There is no problem with doing this as long as we solve for u(x). Notice that this in and of itself is a separable differential equation.

Such that:

$\displaystyle u(x)y'(x) + u'(x)y(x) = u(x)q(x)$

$\displaystyle (u(x)y(x))' = u(x)q(x)$

Now, back to $\displaystyle u'(x) = u(x)p(x)$, we can solve this like any separable equation.

$\displaystyle \frac{u'(x)}{u(x)} = p(x)$

So we have the form:

$\displaystyle \frac{du}{u} = p(x)dx$

Note, that at this moment p(x) can be anything... so let's integrate:

$\displaystyle \int \frac{1}{u} ~du = \int p(x) ~dx$

Note: We don't need a constant since it will be brought in in the general solution.

$\displaystyle ln(u) = \int p(x) ~dx$

$\displaystyle u = e^{\int p(x) ~dx}$

Now, here is our factor u. We just put this back into the equation:

$\displaystyle (u(x)y(x))' = u(x)q(x)$

$\displaystyle \left(e^{\int p(x) ~dx}y(x)\right)' = e^{\int p(x) ~dx}q(x)$

Now we integrate both sides:

$\displaystyle \int \left(e^{\int p(x) ~dx}y(x)\right)' ~dx = \int e^{\int p(x) ~dx}q(x) ~dx$

$\displaystyle e^{\int p(x) ~dx}y(x) = \int e^{\int p(x) ~dx}q(x) ~dx + C$

$\displaystyle y(x) = \frac{\int e^{\int p(x) ~dx}q(x) ~dx + C}{e^{\int p(x) ~dx}}$

Now, recall that p(x) = -2 and q(x) = -4x, so first we'll solve the exponential:

$\displaystyle e^{\int -2 ~dx} = e^{-2x}$

So we have:

$\displaystyle y(x) = \frac{\int e^{-2x}(-4x) ~dx + C}{e^{-2x}}$

Now we integrate the numerator:

$\displaystyle \int e^{-2x}(-4x) ~dx$

The integral of which is:

$\displaystyle e^{-2x}(2x + 1)$ (Integration by parts)

So, our solution is:

$\displaystyle y(x) = \frac{e^{-2x}(2x + 1) + C}{e^{-2x}}$

$\displaystyle y(x) = (2x + 1) + Ce^{2x}$

Now we plug this into the differential equation to see if it actually is a solution:

$\displaystyle y'(x) = 2Ce^{2x} + 2$

So, we get:

$\displaystyle 2Ce^{2x} + 2 - 2[Ce^{2x} + 2x + 1] = -4x$

$\displaystyle (2Ce^{2x} - 2Ce^{2x}) + (2 - 2) - 4x = -4x$

$\displaystyle 0 + 0 - 4x = -4x$

$\displaystyle -4x = -4x$

This is true, so our solution is valid.

I hope this covers it.

6. Okay, that helps, but for the same equation:
Let g be the function that satisfies the given differential equation with the initial condition g(0) = 0. Does the graph of g have a local extremum at the point (0,0)? If so, is the point a local maximum or a local minimum? Justify your answer.
I think I am supposed to figure this out without the solution to the differential equation that you helped me with above.