Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Integrating ##d\psi=(x+y)dx +x_0dy##

  1. Sep 30, 2014 #1
    I am quite embarrassed to ask this question, as I know i have lost track of the concept here, but Ill nevertheless ask it. I was going through Mathematical methods for physicists (pg 333), and there was an example:

    "Solve $$y'+(1+\frac{y}{x}) = 0$$"

    My problem is,

    (a) when you put the equation into the general form of an exact equation, and get:

    $$\psi = \int^{x}_{x_0} (x+y)dx + \int^{y}_{y_0} x_0dy$$,
    $$\psi = \frac{x^2}{2} + xy + C$$,

    Why do you treat y and x as constant wrt to each other when integrating?

    More specifically, why is $$\int^{y}_{y_0} x_0dy = x_0 \int^{y}_{y_0} dy$$, and the same thing with y in the first integral? There is no explicit assumption of dependence of x on y and vice versa, So I'm guessing it is because P and Q of the exact solution are functions of 2 variables, but you integrate only wrt one.

    (b) Why are the rest of the terms($$-x_0^2/2 , x_0y_0)$$, of the integral constant?

    I would like to stress that it is NOT my objective to SOLVE the equation, but to get my concept of integrating different variables wrt to each other clear. In brief, I want to know how to integrate expressions such as (x+y) and xy wrt to x(or y). And I am not talking about double integrals here. If you don't have y=f(x) as an expansion, i.e. x and y are mere variables when integrated wrt each other, how to integrate the expression is my query. Also, from the book it seems that they have taken $$\int(x+y) dx = \int x dx + \int y dx$$,i.e "distributed the integrand". How can you do that, since the integral is only once, how can you make 2 integrals out of it? In short, does integration have some sort of distributive rule and each term of the expression in brackets integrated separately wrt the variable in question(dx in this case)? If so, then WHY? or am I missing something? Please elaborate.
    Thanks in advance!!!
     
  2. jcsd
  3. Sep 30, 2014 #2

    Mark44

    Staff: Mentor

    You don't. This would be reasonable if x and y were independent of each other. However, this isn't the case here, as we assume that y is a function of x.
    Because x0 is a constant. One of the basic properties of definite integrals is that the integral of a constant times a function is the constant times the integral of the function. Also, the integral of the sum of two functions is the sum of the integrals of the functions. These properties follow from the linearity of the definite integral.
    This is a legitimate step, but the problem is that you can't do the second integral. That integral needs to be performed with respect to x, but you can't replace y with its equivalent form in terms of x.
    I didn't check all of your work in detail to verify that the DE you have is exact. For this equation, a simpler approach is to use a so-called integrating factor.

    Rewrite the equation as y' + y/x = -1
    It turns out that the integrating factor is $$\phi(x) = e^{\int \frac{dx}{x}} = e^{ln(x)} = x$$
    Multiply both sides of the original DE by the integrating factor, resulting in xy' + y = -x, or d/dx(xy) = -x
    Now integrate both sides (with respect to x) to get xy = -(1/2)x2 + C
    Solve for y to get your solution as a function of x.
     
  4. Sep 30, 2014 #3

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    I would have done this in a slightly different format. We can write [itex]dy/dx= -1- y/x[/itex] as [itex]xdy= (-x- y) dx[/itex] or [itex]xdy+ (x+ y)dy= 0[/itex].

    Yes, that is exact- the derivative of x with respect to x and the derivative of x+ y with respect to y are both 1. That means there exist a function F(x, y) such that [itex]dF= F_x dx+ F_y dy= (x+ y)dx+ xdy[/itex]. We have [itex]F_x= x+ y[/itex] and [itex]F_y= x[/itex]. Since the partial derivative with respect to y is done holding x constant we must have [itex]F= xy+ \phi(x)[/itex]. Here [itex]\phi(x)[/itex] is the "constant of integration". Since taking the partial derivative, we treat x as a constant, the "constant of integration" may be a function of x.

    Differentiating [itex]F= xy+ \phi(x)[/itex] with respect to x, [itex]F_x= y+ \phi'(x)[/itex]. But we already have [itex]F_x= x+ y[/itex] so [itex]y+ \phi'(x)= x+ y[/itex] which gives [itex]\phi'(x)= x[/itex] and so [itex]\phi(x)= x^2/2+ C[/itex]

    [itex]F(x, y)= xy+ x^2/2+ C[/itex]. dF= 0 means that F is a constant- [itex]F(x, y)= xy+ x^2/2+ C= C'[/itex]. Combining the two constants, [itex]xy+ x^2/2= C[/itex].
     
    Last edited: Oct 2, 2014
  5. Oct 2, 2014 #4
    @Mark44, That is not my question. I know I can solve it using other methods. My question is about the reason of doing the integrals in the way done in the book. For instance, I asked why is $$x_0$$ a constant, because that's what taking it outside the integral implies(which is what they have done in the book). As for $$\int y dx$$, they have equated it to yx, which means y is a constant wrt x...But how?? I don't mean to say why do you take the constant outside the integral, I meant WHY is the thing a constant, because that is what the next step ($$\int x_0 dy= x_0y$$, and $$\int(x+y)dx = x^2/2 + xy$$ - This is the thing done in the textbook, I don't understand how) implies. So the thing in brackets is my question really. Thanks again!!
     
  6. Oct 2, 2014 #5

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    Any integral "dy" treats all other independent variables as constants. Any integral "dx" treats all other independent variables as constants. It is just the "reverse" of partial differentiation.
     
  7. Oct 3, 2014 #6
    But the thing is, there is no specified dependence/independence of variables here....Or is it assumed so?
     
  8. Oct 3, 2014 #7

    Mark44

    Staff: Mentor

    The variables are assumed to be independent here.
     
  9. Oct 4, 2014 #8
    Ok, Thanks a lot!!!
     
  10. Oct 6, 2014 #9
    But @Mark44, here, y is a function of x ( we have a y'), so $$\int y dx$$ cannot be evaluated unless you know what y exactly is, right? How can you then assume it to be independent when integrating wrt dx? Sorry for restarting this, but I still don't get it...
     
  11. Oct 6, 2014 #10

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    If y is a function of x, then, no, you cannot integrate it with respect to x. But if you know that was from a partial derivative with respect to x, then y is being treated as a constant so the anti-derivative, under those circumstances would be [itex]xy+ f(y)[/itex] where f(y) can be any function of y.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook