Weird integral curve on GeoGebra

360 Views Asked by At

I graphed the direction field of the differential equation at GeoGebra $$y'=\frac{x-y}{x+y}$$ and here is the result:

enter image description here

Both the direction field and the integral curve passing through $(1,1)$ look fine, but there is a really weird curve $(2,-1)$; I am almost certain it is incorrect even without calculation. May I know the cause of the problem and how to fix it (other than simply remove it)?

2

There are 2 best solutions below

1
On

Note that the differential equation is undefined on the line $x+y=0$, with $|dy/dx|\to \infty$ as you approach that line. Numerical solvers can do funny things when they approach a singularity.

Instead of this differential equation, you might look at the system $$ \eqalign{\dfrac{dy}{dt} &= x-y\cr \dfrac{dx}{dt} &= x+y\cr}$$ The solutions of your differential equation correspond to trajectories of this system, except that the solutions of the differential equation cease to exist when they hit $x+y=0$, while the trajectories of the system just change the sign of $dx/dt$.

3
On

There are already good comments and an answer.

You should try another solver like Bluffton.

Mathematica also produces (notice the line $y = -x$)

enter image description here

The Mathematica code to generate this is

  pl = Plot[-x, {x, -5, 5}, PlotStyle -> Red];

  sp = StreamPlot[{1, (x - y)/(x + y)}, {x, -5, 5}, {y, -5, 5}, ImageSize -> Large]; 

  Show[sp, pl]