Let M(x,y) and N(x,y) be two smooth functions having
continuous partial derivatives in some domain \( \Omega
\subset \mathbb{R}^2 \) without holes. A differential equation,
written in differentials
because the total differential of ψ is \( {\text d}
\psi = \psi_x {\text d}x + \psi_y {\text d} y \)
for all \( x \in \Omega . \)
The second method utilizes line integration, which is preferred for solving
initial value problems. Indeed, suppose we are given an initial value problem
for an exact equation:
Let L be arbitrary curve starting at \( (x_0 ,y_0 )
\) and ending at arbitrary point \( (x,y) . \)
This curve or line should be without self-intersections and belong to
the domain Ω where functions M(x,y) and N(x,y) possess
continuous derivatives. Then the potential function can be obtained as
In practice, we choose L as a semi-linear line going parallel to axes
from initial point \( (x_0 ,y_0 ) \) and finishing
at arbitrary point \( (x,y) \in \mathbb{R}^2 . \)
In particular, we can integrate first along vertical axis and then
horizontally, or we can integrate horizontally and then vertically.
window:=plot::Arrow2d([-1,-1],[-1,-1],LineColor=RGB::Blue)
line1:=plot::Arrow2d([1,.5],[4,.5],LineColor=RGB::Blue,LineStyle=Dashed,Title="(x0,y0)",TitlePosition=[.75,.25])
line2:=plot::Arrow2d([4,.5],[4,4.5],LineColor=RGB::Blue,LineStyle=Dashed,Title="(x,y)",TitlePosition=[4.2,4.7])
line3:=plot::Arrow2d([1,.5],[1,4.5],LineColor=RGB::Black)
line4:=plot::Arrow2d([1,4.5],[4,4.5],LineColor=RGB::Black)
plot(window,line1,line2,line3,line4,Header="Two Lines of Integration")
Two lines of integration.
If we integrate along black line (vertically where dx = 0 and then horizontally where dy = 0), we get
Example:
The equation \( y \,\text{d}x + x \,\text{d}y =0 \) is exact because \( M_y =1 = N_x \) for \( M= y \quad\mbox{and} \quad N= x . \) Suppose that the initial condition \( y(2)=3 \) is given.
We type in MuPad:
reset()
M:=y
y
N:=x
x
initcondx:=2
2
initcondy:=3
3
Check to see if this equation is exact
is(diff(M,y)=diff(N,x))
TRUE
Check that integrating along either the black line (Psi1) or the blue line
(Psi2) will give the same solution
When defining a function to plot (separate from inside the plot function),
sometimes it is nice to include a parameter for the line color - 'LineColor = RGB::Red' - which literally stands for 'choose between red green and blue for your line'.
Notice that there is an extra identifier in front of the plot function this
time '::Function2d'. This is just to indicate to MuPad that we want it to be
a 2 dimensional graph in cases of a 3 dimensional object. In the case where
you are plotting objects of multiple variables, this can be very useful. To
get a 3 dimensional graph, all you have to do is change the '2' above to a '3'.
Labels are used as parameters inside the plot function. The syntax is as
follows: 'Header = ['This Is My Title']' and 'AxesTitles = ['Xaxis Title', 'YAxis Title']'. Here is an example with all the aspects at once: