(* Problem 3 *)
(* Consider differential equations of the form a(x) + b(x)dy /dx=0 *) \
(* Use mathematica to determin if they are in Exact form or not. If they are, use CountourPlot to graph the different solution curves 3.a 3x^2+y + (x+3y^2)dy /dx=0 3.b cos(x) + sin(x) dy /dx=0 3.c y e^xy+ x e^xydy/dx=0
3a. Please find attached code.. Here in code a = a1-a2 if it is zero contour plot is done manualy. It is not working in if/while loop in mathematica. c is arbitrary constant, choose different values and check.
m=3x^2+y;
n=x+3y^2;
a1 = D[m,y];
a2=D[n,x];
a=a1-a2;
M1=Integrate[m,x];
n1=3y^2;
N1 = Integrate[n1,y]
Ans= M1+N1 -c;
c=3;
ContourPlot[Ans, {x, -10, 10}, {y, -10, 10}] ;
3b. a is not zero, hence it is not exact.
m=cos[x];
n=sin[x];
a1 = D[m,y];
a2=D[n,x];
a=a1-a2
3c.
m=y exp[xy];
n=x exp[xy];
a1 = D[m,y];
a2=D[n,x];
a=a1-a2;
M1=Integrate[m,x];
n1= 0;
N1 = Integrate[n1,y];
Ans= M1+N1 -c
c=0;
ContourPlot[Ans, {x, -10, 10}, {y, -10, 10}] ;
Get Answers For Free
Most questions answered within 1 hours.