# Preface

Solving equations of the form: \( \frac{{\text d}y}{{\text d}x} = f \left( \frac{ax+by+c}{Ax+By +C} \right) , \quad Ax+By +C \ne 0 \) was first accomplished by Carl Jacobi (1804--1851) in 1842 (Journal für die reine und angewandte Mathematik).

Return to computing page for the second course APMA0340

Return to Mathematica tutorial for the second course APMA0340

Return to the main page for the course APMA0330

Return to the main page for the course APMA0340

Return to Part II of the course APMA0330

## Glossary

# Equations with Linear Fractions

A wide class of differential equations of the form

*a*,

*b*,

*c*, and

*A*,

*B*,

*C*are some given constants and the function of one variable

*f(v)*is assumed to be continuous within some interval. Without any loss of generality, we consider only the case when two lines defined by equations ax+by+c = 0 and Ax+By+C = 0 are not parallel (\( aB - Ab \ne 0 \) ). Otherwise, the above equation can be reduced to a separable equation upon substitution v = ax+by+c or v = Ax+By+C, which was demonstrated in the previous section.

If \( aB - Ab \ne 0 ,\) constants c and C can be eliminated by shifting the system of coordinates:

We start our exposition by considering equations with slope function as the ratio of two linear functions:

**Example: **:
Consider the differential equation:

We plot the corresponding direction fields using **StreamPlot** command:

StreamPoints -> {Tuples[Range[-1, 4, 0.2], 2], Automatic, 10},

ImageSize -> Medium, StreamStyle -> "Line"]

**Example: **:
Consider an algebraic equation: \( 2 x^2 + y^2 - 2 x y + 5 x =0 \) and we wish to
determine a differential equation to which the algebraic equation defines implicitly its solution. *Mathematica*
is capable to find the required differential equation.

To extract the left-hand side, type:

Axes -> Automatic, AxesOrigin -> {0, 0},

AxesStyle -> GrayLevel[0.5], PlotPoints -> 100, Contours -> {0},

ContourShading -> False]

If the option

**ContourShading**is removed, we will get

In the above graphs, the option

**Contour->{0}**instructs

*Mathematica*to graph only the level curve corresponding to 0.

The option

**ContourShading -> False**specifies to not shade the regions between contours,

**Frame -> False**specifies that a frame is not to be placed around the resulting graphics objects,

**Axes -> Automatic**specifies that axes are to be placed on the resulting graphics objects while the option

**AxesOrigin -> {0, 0}**specifies that they intersect at the point (0,0), and the option

**AxesStyle -> GrayLevel[0.5]**specifies that they be drawn in a medium shade of gray.

The option

**PlotPoints -> 100**instructs

*Mathematica*to increase the number of sample points to 100 (the default is 15), helping assure that the resulting graphic object appears smooth.

Note that instead of eq[[1]], one can use the equation 5 x + 2 x^2 - 2 x y + y^2 explicitly.

Now we instruct *Mathematica* to find the differential equation in two steps.

Therefore, we get the differential equation

StreamPoints -> RandomReal[{-6, 0}, {#, 2}],

StreamColorFunction -> (GrayLevel[RandomReal[]] &),

ImageSize -> 500] &, ConstantArray[50, 100]];

Show[t]

xrange = {-6, 1};

yrange = {-6, 1};

xdivs = 3;

ydivs = 3;

xranges = Partition[Rescale[Range[0, xdivs], {0, xdivs}, xrange], 2, 1];

yranges = Partition[Rescale[Range[0, ydivs], {0, ydivs}, yrange], 2, 1];

Show[Flatten@

Table[StreamPlot[

f[x, y], {x, First@xr, Last@xr}, {y, First@yr, Last@yr},

StreamScale -> {0.2, Automatic, 0.01}, StreamPoints -> 100], {xr,

xranges}, {yr, yranges}], PlotRange -> All, ImageSize -> Large]

LineIntegralConvolutionScale -> 0.6,

ColorFunction -> GrayLevel, RasterSize -> 200]

**Example: **:
Consider the differential equation

*x = 1*where the integral curves have an infinite slope. The right-hand side function (= slope function) is a composition of two functions:

*F(z(x,y))*is not homogeneous, but it can be converted to a homogeneous one by shifting

Now we return to the original variables. Since \( X=x-1, \ Y=y \), and
\( v=Y/X, \) the original differential equation has the general solution

in implicit form:

*Mathematica*commands:

Plot[((x - 1)*(#1 Abs[x - 1]^a *(9 - a) - 9 - a)/(#1 Abs[x - 1]^a - 1)/ 8 &) /@ {-1, 0, 1, 2, 3}, {x, -5, 10}]

Return to Mathematica page

Return to the main page (APMA0330)

Return to the Part 1 (Plotting)

Return to the Part 2 (First Order ODEs)

Return to the Part 3 (Numerical Methods)

Return to the Part 4 (Second and Higher Order ODEs)

Return to the Part 5 (Series and Recurrences)

Return to the Part 6 (Laplace Transform)

Return to the Part 7 (Boundary Value
Problems)