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

Differential equation question

  1. Aug 4, 2005 #1
    For this problem, "Please solve (2x-y+1)dx+(x+y)dy=0 "
    My guess is that you have to make a linear transformation first to simplify the equation. However, I don't know how to make a linear transformation.
  2. jcsd
  3. Aug 4, 2005 #2


    User Avatar
    Science Advisor
    Homework Helper

    rearrange to

    [tex]2x-y+1 + (x+y)dy = 0 [/tex] and test for exactness
  4. Aug 5, 2005 #3
    why did you take off the dx?
  5. Aug 5, 2005 #4


    User Avatar
    Science Advisor
    Homework Helper

    First find out where the two lines:


    intersect, say (h,k)

    Then make the transformation:


    Then substitute back into the ODE and solve in terms of u and v which should be homogeneous now.
  6. Aug 5, 2005 #5
    Why do you have to find the intersection?
  7. Aug 6, 2005 #6


    User Avatar
    Science Advisor
    Homework Helper

    Our objective is to remove the constant terms in both differential expressions so that we can obtain a homogeneous equation of order one. The simplest way to do that is to "translate the axes". Like if you had a linear equation: y(x)=4x+1 and you wanted to remove the 1. You could do that by translating the axes to the point (-1/4,0). That is, let v=y and u=x+1/4.

    Substituting, we get: v=4(u-1/4)+1 or v=4u.

    Same dif with the ODE above: If we have the expression:


    and we consider the lines:



    And find their intersection (h,k), then the translation:



    will remove the constant terms and result in equations of the form:



    How about a plot? Just use any old initial conditions that work.
  8. Aug 6, 2005 #7
    thank you very much! :)
  9. Aug 7, 2005 #8


    User Avatar
    Science Advisor
    Homework Helper

    You know, this isn't an easy equation to analyze.

    In terms of u and v I get so far:


    Now I don't know how other people are, but that's just not good enough for me. Subsittuting x and y only make's it worst. I mean, what do you do with it in order to extract meaningful data from it? Well, turns out there's lots you can do with it.

    The ODE is an example of the quintessential model of non-linear dynamics:


    Solutions, depending on the coefficients, fall into several classes which exhibit typical non-linear behavior.

    A thorough analysis of that behavior along with the behavior of this one:


    allows one, I think, to begin to obtain a unique perspective into the workings of nature since our world is massively non-linear. :smile:

    Edit: Went over it again. Needed a negative sign in front of ArcTan.
    Last edited: Aug 7, 2005
  10. Aug 7, 2005 #9


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    saltydog skipped a step in the explanation. :smile: He jumped past "make a linear transformation" straight to figuring out what kind of linear transformation he wants to make.

    A linear transformation is a transformation that looks like:

    [tex](p, q) \rightarrow (a_1 p + b_1 q, a_2 p + b_2 q)[/tex]

    What you probably really wanted to do is to make an affine transformation (and what saltydog did was an affine transformation, not a linear one):

    [tex](p, q) \rightarrow (a_1 p + b_1 q + c_1, a_2 p + b_2 q + c_2)[/tex]

    So what you want to do is to define new variables, (u, v), by call the pre-transformed coordinates (x, y) and the post-transformed coordinates (u, v).

    In other words, define

    [tex](u, v) := (a_1 x + b_1 y + c_1, a_2 x + b_2 y + c_2)[/tex]

    Then, once you've made the substitution, you can try and figure out what values for the coefficients would yield an equation you know how to solve.

    Personally, I'd've done a different transformation: I would have aimed to eliminate the v dv term so that I could turn it into an ordinary first order differential equation. (with complex coefficients)
    Last edited: Aug 7, 2005
  11. Aug 7, 2005 #10


    User Avatar
    Science Advisor
    Homework Helper

    Do you mean from this equation:


    Could you please explain how or at least give more information regarding this technique?
  12. Aug 7, 2005 #11


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Starting with

    (2x - y + 1) dx + (x + y) dy = 0

    I make the change of variable:

    x = a1 u + b1 v
    y = a2 u + b2 v

    giving me:

    (e1 u + e2 v + e3) du + (f1 u + f2 v + f3) dv = 0

    In particular, I compute:

    [tex]f_2 = 2 b_1^2 + b_2^2[/tex]

    So, if I set b1 and b2 so that f2 = 0, then I've eliminated the v dv term.

    It seemed the simplest substitution would be:

    x = iv
    y = u + √2 v

    Which yields, after rearrangement (if I've made no errors):

    \frac{dv}{du} + \frac{\sqrt{2} + i}{i + (\sqrt{2} - i) u} v
    = \frac{-u}{i + (\sqrt{2} - i) u}

    Which one can solve with standard methods. The trick is getting a real answer for x and y at the end, but I expect to be able to do so, even if it involves trying put logarithms together to form inverse trig functions.

    P.S. I make no claim my approach is better, just that I expect I can do it. :smile:
    Last edited: Aug 7, 2005
  13. Aug 7, 2005 #12


    User Avatar
    Science Advisor
    Homework Helper

    Ok Hurkyl. That's very interesting. I'll work with it. :smile:

    Edit: Ok, I got the same ODE in v and u as you did with your substitutions so I go on from there (not that I don't trust you or nothing, you know what I mean :smile: )
    Last edited: Aug 7, 2005
  14. Aug 8, 2005 #13
    wow! thanks!!! :)
    but there's one thing I'm not too clear on...
    What the difference between an affine and linear transformation?
  15. Aug 8, 2005 #14


    User Avatar
    Science Advisor
    Homework Helper

    Asdf, one method of handling the solution is to convert it to polar coordinates. Wanna look at that? What will the following look like in a new coordinate system in terms of polar coordinates?


    You know, convert to polar coordinates, take the exponential, end up with something like:


    But that will be in a coordinate system different than x and y. What to do to get the plot in terms of x and y?
  16. Aug 8, 2005 #15


    User Avatar
    Science Advisor
    Homework Helper

    I verified the solution by implicit differentiation in Mathematica and then solving for y'[x]. This is the code I used:

    Code (Text):
    [tex]\qquad D[\sqrt{2}ln\left[\sqrt{2(x+1/3)^2+(y[x]-1/3)^2}\right]== -ArcTan\left[\frac{y[x]-1/3}{\sqrt{2}(x+1/3)}\right]+k,x]],y'[x]]][/tex]

    Mathematica returns the RHS of the ODE so I have some confidence the solution is correct. Also the results agree with numerical results in a valid region (no vertical slopes).

    However, I'm just disappointed that I know of no other way to plot it then the brute-force approach below which just checks every point in the x-y plane that fits the equation using a value of k determined by the IVP: y(0)=1. A plot is attached.

    If someone knows of a better way (I'm still looking at Hurkyl's approach but get stuck when evaluating the last integration), please let me know.

    Code (Text):
    plotlist1 = Table[{0, 0}, {50000}];
    index = 0;
    For[x = -5, x <= 5, x += 0.01;
        For[y = -5, y <= 5, y += 0.01,
    [tex]\quad ytest=\sqrt{2}ln\left[\sqrt{2(x+1/3)^2+(y[x]-1/3)^2}\right]+ArcTan\left[\frac{y[x]-1/3}{\sqrt{2}(x+1/3)}\right][/tex]
                If[Abs[ytest - k] <= 0.01,
            plotlist1[[index]] = {x, y};
    plotlist = Take[plotlist1, index];
    lp1 = ListPlot[plotlist1, PlotRange -> {{-6, 6}, {-6, 6}}]

    Attached Files:

  17. Aug 9, 2005 #16
    just a thought~
    i think that maybe in this case, it looks like it'll be harder if you convert it to polar coordinates... because aren't usually polar coordinates used when you see "x^2+y^2" or something similar? otherwise it'd probably get more complicated~
  18. Aug 9, 2005 #17


    User Avatar
    Science Advisor
    Homework Helper


    Hello Asdf,

    I've made progress with this. You're right, polar coordinates is not the way to go. I analyzed it parametrically. In summary, for the IVP:

    [tex]\frac{dy}{dx}=-\frac{(2x-y+1)}{x+y},\quad y(0)=1[/tex]

    The solution in parametric form is:

    [tex]x(t)=k_1 e^t Cos[\sqrt{2}t]+k_2e^t Sin[\sqrt{2}t]-1/3[/tex]





    A plot is attached. It's a logarithmic spiral. Rock and roll.

    Edit: The second plot exhibits the vertical slope when x=-y as per the ODE.

    Attached Files:

    Last edited: Aug 9, 2005
  19. Aug 9, 2005 #18
    wow! I missed the thought to analyze it parametrically...
    I admire your patience and preserverence in analyzing this solution~
    thank you very much!
    interesting plot~
  20. Aug 10, 2005 #19


    User Avatar
    Science Advisor
    Homework Helper

    Here's the parametric analysis for those interested.


    [tex](2x-y+1)dx+(x+y)dy=0,\quad y(0)=1[/tex]




    We obtain:

    [tex](2u-v)du+(u+v)dv=0,\quad v(1/3)=2/3[/tex]



    Now, this is the same as:


    or the system:

    [tex]\frac{dv}{dt}=v-2u,\quad v(0)=2/3[/tex]

    [tex]\frac{du}{dt}=v+u,\quad u(0)=1/3[/tex]

    The eigenvalues for which are complex:


    Choosing the positive one and calculating an eigenvector, we obtain for the solution:

    [tex]\left(\begin{array}{c} v \\
    \left(\begin{array}{c} \sqrt{2}i \\

    Solving using Euler's formula and separating into real and imaginary parts we have for the solution:

    [tex]\left(\begin{array}{c} v \\
    \left(\begin{array}{c} -\sqrt{2}Sin[\sqrt{2}t] \\
    \left(\begin{array}{c} \sqrt{2}Cos[\sqrt{2}t] \\


    [tex] x(t)=u(t)-1/3[/tex]

  21. Aug 10, 2005 #20
    It's clearly not exact and i its i.f. is function is of both x & y,
    Salty's way i think is the only way to do it!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook