0% found this document useful (0 votes)
62 views

Math Lab

The document contains examples of using Taylor expansions to approximate functions around points. It shows the Taylor expansion of sin(x) around x=0 up to the 7th term, and the Taylor expansion of e^x*cos(y) around the point x=1, y=π/4 up to the 3rd term in both x-1 and y-π/4. It also contains examples of proving trigonometric identities and finding derivatives.

Uploaded by

Mohammed Uzair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Math Lab

The document contains examples of using Taylor expansions to approximate functions around points. It shows the Taylor expansion of sin(x) around x=0 up to the 7th term, and the Taylor expansion of e^x*cos(y) around the point x=1, y=π/4 up to the 3rd term in both x-1 and y-π/4. It also contains examples of proving trigonometric identities and finding derivatives.

Uploaded by

Mohammed Uzair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

unit1.

wxmx 1 / 14

 ➔   UNIT 1:

 ➔    If y = sin sin x , Prove that 𝑑2𝑦 𝑑𝑥2
+ 𝑡𝑎𝑛𝑥
𝑑𝑦 𝑑𝑥
+ 𝑦𝑐𝑜𝑠2𝑥 = 0

 ➔   y:sin(sin(x));
 y1:diff(y,x,1);
 y2:diff(y,x,2);
 y3: sin(x)/cos(x);
 y:y2+ y3·y1+y·cos(x)^2;
(y) sin ( sin ( x ) )
(y1) cos ( x ) cos ( sin ( x ) )
(y2) − cos ( x ) 2 sin ( sin ( x ) ) − sin ( x ) cos ( sin ( x ) )
sin ( x )
(y3)
cos ( x )
(y) 0

 ➔    If y = cosx cos2xcos3x find y9

 ➔   y:cos(x)·cos(2·x)·cos(3·x); 
y9: diff(y,x,9);
(y) cos ( x ) cos ( 2 x ) cos ( 3 x )
(y9) 2453760 sin ( x ) sin ( 2 x ) sin ( 3 x ) − 2585088 cos ( x ) cos ( 2 x ) sin ( 3 x )
− 2584832 cos ( x ) sin ( 2 x ) cos ( 3 x ) − 2454016 sin ( x ) cos ( 2 x ) cos ( 3 x )

 ➔    Show that the angle of intersection of the curves r = sin(𝜃) + cos(𝜃)and 𝑟 = 2sin(𝜃)is    𝜋 4 using the
and tangent for the curves.
unit1.wxmx 2 / 14

 ➔   r1:sin(%theta)+cos(%theta); 
r2: 2·sin(%theta); 
A1:trigreduce(r1/diff(r1,%theta)); 
A2:trigreduce(r2/diff(r2,%theta)); 
phi:trigsimp(trigreduce((A1−A2)/(1+A1·A2))); 
atan(phi);
(r1) sin ( θ ) + cos ( θ )
(r2) 2 sin ( θ )
sin ( θ ) cos ( θ )
(A1) − −
sin ( θ ) − cos ( θ ) sin ( θ ) − cos ( θ )
(A2) tan ( θ )
(phi) 1
π
(%o34) 
4

 ➔   Show that the curves 𝑟𝑛 = 𝑎𝑛cos(𝑛𝜃) and  𝑟𝑛 = 𝑏𝑛sin(𝑛𝜃) intersect orthogonally.

 ➔   r1:(a^n·cos(n·%theta))^(1/n);
 r2:(b^n·sin(n·%theta))^(1/n);
 A1:(r1/diff(r1,%theta));
 A2:(r2/diff(r2,%theta));
 product:A1·A2;
1 /n
(r1) ( a n cos ( θ n ) )
1 /n
(r2) ( b n sin ( θ n ) )
cos ( θ n )
(A1) −
sin ( θ n )
sin ( θ n )
(A2)
cos ( θ n )
(product) − 1

 ➔    Find the Radius of curvature at the origin for 𝑦2 = 𝑥2(3+𝑥 /3−x )
unit1.wxmx 3 / 14

 ➔   y: x·((3+x)/(3−x))^(1/2); 
y1:diff(y,x); y2:diff(y1,x); 
roc: ((1+y1)^(3/2))/y2; 
at(roc,x=0);
x+3
(y) x
3−x
x+3 1
x +
x+3 ( 3−x) 2 3−x
(y1) +
3−x x+3
2
3−x
x+3 1 2 2 ( x+3) 2
x+3 1
x + + x +
( 3−x)2 3−x ( 3−x)2 3−x ( 3−x)3 ( 3−x)2
(y2) − /
+ +
x+3 3 2 x+3 x+3
4 2
3−x 3−x 3−x
x+3 1 3 /2
x +
x+3 ( 3−x)2 3−x
+ +1
3−x x+3
2
3−x
(roc) 2
x+3 1 x+3 1 2 ( x+3) 2
x + + x +
( 3−x)2 3−x ( 3−x)2 3−x ( 3−x)3 ( 3−x)2
− + +
x + 3 3 /2 x+3 x+3
4 2
3−x 3−x 3−x

(%o44)  3 2

 ➔   Find the Taylor’s expansion of sqrt of 𝟏 + 𝒙 + 𝒚𝟐 in powers of (x−1) and (y−0).

 ➔    

0.5
x2 ( x + 3 )
(u) +x+1
3−x
x+3
taylor: x cannot be a variable.
3−x
 −− an error. To debug this try: debugmode(true);

 ➔    −− an error. To debug this try: debugmode(true);
incorrect syntax: error is not an infix operator
−− an error.
          ^
unit1.wxmx 4 / 14

 ➔   debugmode(true);

(%o61)  true

 ➔   kill(all);
(%o0)  done

 ➔   u:(1+x+y^2)^0.5; 
 taylor(u,[x,1,3],[y,0,3]);
0.5
(u) ( y2+x+1)
rat: replaced 0.5 by 1/2 = 0.5
2 y2 2 2 y2 2 3 2 y2
(%o2)/T/  2+ + ... + − + ... ( x − 1 ) + − + + ...
4 4 16 32 128
2 5 2 y2
( x−1) 2+ −
3
+ ... ( x − 1 ) + ...
128 512

 ➔   kill(all);
(%o0)  done

 ➔    Find the Taylor’s expansion of 𝒆𝒙cosy about the point x=1,y=π/4.

 ➔    u:%e^x·cos(y);  
taylor(u,[x,1,3],[y,%pi/4,3]);
(u) %e x cos ( y )
π π 2 π 3
2 %e y − 2 %e y − 2 %e y −
2 %e 4 4 4
(%o2)/T/  − − + + ... +
2 2 4 12
π π 2 π 3
2 %e y − 2 %e y − 2 %e y −
2 %e 4 4 4 ( x−1) +
− − + + ...
2 2 4 12
π π 2 π 3
2 %e y − 2 %e y − 2 %e y −
2 %e 4 4 4 ( x−1) 2
− − + + ...
4 4 8 24
π π 2 π 3
2 %e y − 2 %e y − 2 %e y −
+ 2 %e 4 4 4
− − + + ...
12 12 24 72
( x − 1 ) 3 + ...
unit1.wxmx 5 / 14

 ➔   TAYLOR  MACLAUREN FOR ONE VARIABLE:

 ➔   sinx expansion

 ➔   u: sin(x);
taylor(u,[x,0,7]);
(u) sin ( x )
x3 x5 x7
(%o4)/T/  x − + − + ...
6 120 5040

 ➔   UNIT 2

 ➔    If U = 𝑠𝑖𝑛−1(xyz) find 𝑈𝑥,𝑈𝑦,𝑈𝑥𝑥,𝑈𝑦𝑦,𝑈𝑥𝑦,𝑈𝑦𝑥,𝑈𝑧,𝑈𝑧𝑧,𝑈𝑧𝑦,𝑈𝑧𝑥,𝑈𝑥𝑧, 𝑈𝑦𝑧,𝑈𝑥𝑥𝑥,𝑈𝑦𝑦𝑦,𝑈𝑧𝑧𝑧,𝑈𝑥𝑥𝑦,𝑈𝑦𝑥𝑦.
unit1.wxmx 6 / 14

 ➔    u:asin(x·y·z); 
 ux: diff(u,x); 
 uy:diff(u,y); 
uxx:diff(ux,x); 
 uyy:diff(uy,y); 
uxy:diff(ux,y); 
uyx:diff(uy,x); 
 uz:diff(u,z); 
uzz:diff(uz,z);
uzy:diff(uz,y); 
 uzx:diff(uz,x); 
uxz:diff(ux,z); 
 uyz:diff(uy,z); 
 uxxx:diff(uxx,x); 
uyyy:diff(uyy,y); 
 uzzz:diff(uzz,z); 
uxxy:diff(uxx,y); 
 uyxy:diff(uyx,y);
(u) asin ( x y z )
yz
(ux)
1 − x 2 y 2 z2
xz
(uy)
1 − x 2 y 2 z2
x y 3 z3
(uxx)
3 /2
( 1 − x 2 y 2 z2 )
x 3 y z3
(uyy)
3 /2
( 1 − x 2 y 2 z2 )
z x 2 y 2 z3
(uxy) +
3 /2
1 − x 2 y 2 z2 ( 1 − x 2 y 2 z2 )
z x 2 y 2 z3
(uyx) +
3 /2
1 − x 2 y 2 z2 ( 1 − x 2 y 2 z2 )
xy
(uz)
1 − x 2 y 2 z2
x3 y 3 z
(uzz)
3 /2
( 1 − x 2 y 2 z2 )
x x 3 y 2 z2
(uzy) +
3 /2
1 − x 2 y 2 z2 ( 1 − x 2 y 2 z2 )
y x 2 y 3 z2
(uzx) +
3 /2
1 − x 2 y 2 z2 ( 1 − x 2 y 2 z2 )
y x 2 y 3 z2
(uxz) +
3 /2
1 − x 2 y 2 z2 ( 1 − x 2 y 2 z2 )
unit1.wxmx 7 / 14

 ➔   kill(all);
(%o0)  done

 ➔    Verify that the given function u=cos(3t)sinx satisfies the wave equation 3^2𝑢𝑥𝑥 = 𝑢𝑡𝑡.

 ➔   u:cos(3·t)·sin(x); 
 utt:diff(u,t,2); 
 uxx:diff(u,x,2); 
 is((3^2)·uxx=utt);
(u) cos ( 3 t ) sin ( x )
(utt) − 9 cos ( 3 t ) sin ( x )
(uxx) − cos ( 3 t ) sin ( x )
(%o4)  true

 ➔   kill(all);
(%o0)  done

 ➔   If 𝒖 = 𝒂𝒙𝟐 + 𝟐𝒉𝒙𝒚 + 𝒚𝟐, Verify Euler’s theorem.

 ➔    u:a·x^2+2·h·x·y+b·y^2; 
 ux:diff(u,x); 
 uy:diff(u,y); 
euler:x·ux+y·uy; 
 eulersimply:ratsimp(euler); 
f:factor(eulersimply); 
 is(f=2·u);
(u) b y 2 + 2 h x y + a x2
(ux) 2 h y +2 a x
(uy) 2 b y +2 h x
(euler) x ( 2 h y +2 a x) +y ( 2 b y +2 h x)
(eulersimply) 2 b y 2 + 4 h x y + 2 a x2
(f) 2 ( b y 2 + 2 h x y + a x2 )
(%o7)  true

 ➔   kill(all);
(%o0)  done

 ➔    If 𝒖 = 𝒍𝒐𝒈
𝒙𝟑+𝒙𝟐𝒚−𝒚𝟐𝒙+𝟐𝒚𝟑 𝒙+𝒚
,Prove that 𝒙𝒖𝒙 + 𝒚𝒖𝒚 = 𝟐,𝒙𝟐𝒖𝒙𝒙 + 𝟐𝒙𝒚𝒖𝒙𝒚 + 𝒚𝟐𝒖𝒚𝒚 = −2
unit1.wxmx 8 / 14

 ➔    u:log((x^3+x^2·y−y^2·x+2·y^3)/(x+y)); 
 ux:diff(u,x); 
 uy:diff(u,y); 
euler:x·ux+y·uy; 
eulersimply:ratsimp(euler); 
uxx:diff(ux,x); 
uxy:diff(ux,y); 
 uyy:diff(uy,y); 
 euler2: x^2·uxx+2·x·y·uxy+y^2·uyy; 
 eulersimply:ratsimp(euler2);
2 y 3 − x y 2 + x2 y + x3
(u) log
y +x
−y2+2 x y + 3 x2 2 y 3 − x y 2 + x2 y + x3
( y +x) −
y +x ( y +x)2
(ux)
2 y 3 − x y 2 + x2 y + x3
6 y 2 − 2 x y + x2 2 y 3 − x y 2 + x2 y + x3
( y +x) −
y +x ( y +x)2
(uy)
2 y 3 − x y 2 + x2 y + x3
6 y 2 − 2 x y + x2 2 y 3 − x y 2 + x2 y + x3
y ( y +x) −
y +x ( y +x)2
(euler) +
2 y 3 − x y 2 + x2 y + x3
− y 2 + 2 x y + 3 x2 2 y 3 − x y 2 + x2 y + x3
x ( y +x) −
y +x ( y +x)2

2 y 3 − x y 2 + x2 y + x3
(eulersimply) 2
− y 2 + 2 x y + 3 x2 2 y 3 − x y 2 + x2 y + x3

y +x ( y +x)2
(uxx) −
2 y 3 − x y 2 + x2 y + x3
− y 2 + 2 x y + 3 x2 2 y 3 − x y 2 + x2 y + x3
( y + x ) ( − y 2 + 2 x y + 3 x2 ) −
y +x ( y +x)2
+
2
( 2 y 3 − x y 2 + x2 y + x3 )
2 ( 2 y 3 − x y 2 + x2 y + x3 ) 2 ( − y 2 + 2 x y + 3 x2 ) 2 y +6 x
( y +x) − +
( y +x) 3
( y +x) 2 y +x

2 y 3 − x y 2 + x2 y + x3
(uxy) ( ( y +x)
2 x−2 y 2 ( 2 y 3 − x y 2 + x2 y + x3 ) 6 y 2 − 2 x y + x2 − y 2 + 2 x y + 3 x2
+ − − )/ (2
y +x ( y +x)3 ( y +x)2 ( y +x)2
− y 2 + 2 x y + 3 x2 2 y 3 − x y 2 + x2 y + x3

y +x ( y +x)2
y 3 − x y 2 + x2 y + x3 ) + −
2 y 3 − x y 2 + x2 y + x3
− y 2 + 2 x y + 3 x2 2 y 3 − x y 2 + x2 y + x3
( y + x ) ( 6 y 2 − 2 x y + x2 ) −
2
unit1.wxmx 9 / 14

 ➔   UNIT 3

 ➔    Plot the graph y^2·(4−x)=x^3 

 ➔  

(%i1)  kill(all);
(%o0)  done

(%i4) load(implicit_plot);
 implicit_plot(y^2·(4−x)=x^3,[x,0,4],[y,−10,10]);
(%o3)  C:/maxima−5.43.0/share/maxima/5.43.0/share/contrib/implicit_plot.lisp
(%o4)  done

Figure 1:

 ➔   2)Plot the graph 9·y^2=x^2·(9−x^2)

(%i5) kill(all);
(%o0)  done

(%i4) load(implicit_plot);
 implicit_plot(9·y^2=x^2·(9−x^2),[x,−4,4],[y,−10,10]);
(%o3)  C:/maxima−5.43.0/share/maxima/5.43.0/share/contrib/implicit_plot.lisp
(%o4)  done
unit1.wxmx 10 / 14

Figure 2:

(%i5) kill(all);
(%o0)  done

(%i4) load(implicit_plot);
implicit_plot(y=(x^2)/(1−x^2),[x,−4,4],[y,−10,10]);
(%o3)  C:/maxima−5.43.0/share/maxima/5.43.0/share/contrib/implicit_plot.lisp
(%o4)  done

Figure 3:

 ➔   UNIT 4
unit1.wxmx 11 / 14

 ➔   If u=x^2−2y and v= x+y. Find the Jacobian.

(%i8) u:x^2−2·y; 
 v:x+y; 
 j:jacobian([u,v],[x,y]); 
D: determinant(j);
(u) x2 − 2 y
(v) y +x
2 x −2
(j)
1 1
(D) 2 x+2

 ➔   2)If x=cosu,y=cosu sinu,z=cosw sinv sin u. Find the Jacobian.

(%i13) kill(all);
(%o0)  done

(%i5)  x:cos(u); 
 y:cos(u)·sin(u); 
 z:cos(w)·sin(v)·sin(u); 
j:jacobian([x,y,z],[u,v,w]); 
 d:determinant(j);
(x) cos ( u )
(y) cos ( u ) sin ( u )
(z) sin ( u ) sin ( v ) cos ( w )
− sin ( u ) 0 0

(j) cos ( u ) 2 − sin ( u ) 2 0 0

cos ( u ) sin ( v ) cos ( w ) sin ( u ) cos ( v ) cos ( w ) − sin ( u ) sin ( v ) sin ( w )

(d) 0

(%i6) kill(all);
(%o0)  done

(%i1) integrate(tan(x)^7,x,0,%pi/4);
5 log ( 2 )
(%o1)  −
12 2
unit1.wxmx 12 / 14

(%i2)  integrate(sin(x)^7,x);
cos ( x ) 7 3 cos ( x ) 5
(%o2)  − + cos ( x ) 3 − cos ( x )
7 5

(%i6)  
 f(x,y):=x·(x^2+y^2);
integrate(f(x,y),y,0,x^2);
integrate(%,x,0,5);
(%o4)  f ( x , y ) := x ( x 2 + y 2 )
x ( x6 + 3 x4 )
(%o5) 
3
453125
(%o6) 
24

(%i7) kill(all);
(%o0)  done

(%i3) f(x,y,z):=x^2+y^2+z^2;
 integrate(integrate(integrate(f(x,y,z),z,−a,a),y,−b,b),x,c,c); 
ratsimp(%);
(%o1)  f ( x , y , z ) := x 2 + y 2 + z 2
(%o2)  0
(%o3)  0

(%i4) kill(all);
(%o0)  done

(%i3) f(x,y,z):=x;
 integrate(integrate(integrate(f(x,y,z),z,0,1−x),x,y^2,1),y,0,1); 
(%o2)  f ( x , y , z ) := x
4
(%o3) 
35

 ➔   3. Evaluate the triple integral of the function f(x,y,z)=x^2 over the region V enclosed by the plane x

(%i5) f(x,y,z):=x^2;
 integrate(integrate(integrate(f(x,y,z),z,0,a−x−y),y,0,a−x),x,0,a); 
(%o4)  f ( x , y , z ) := x 2
a5
(%o5) 
60
unit1.wxmx 13 / 14

 ➔    Solve (x^2 − 1)dy/dx
+ 2𝑥𝑦 = 1 .

(%i6) kill(all);
(%o0)  done

(%i2) linode:(x^2−1)·('diff(y,x))+2·x·y=1; 
ode2(linode,y,x); 
d
(linode) ( x 2 − 1 ) y +2 x y =1
dx
x + %c
(%o2)  y =
x2 − 1

 ➔   Solve 𝑥2 − 1 𝑑𝑦 𝑑𝑥
+ 2𝑥𝑦 = 1 .

(%i4) linode:(x^2−1)·('diff(y,x))+2·x·y=1; 
ode2(linode,y,x); 
d
(linode) ( x 2 − 1 ) y +2 x y =1
dx
x + %c
(%o4)  y =
x2 − 1

 ➔    Solve (x^2+1)dy+2xy dx= cotx dx

(%i6) linode:(x^2+1)·('diff(y,x))+2·x·y−cot(x); 
ode2(linode,y,x); 
d
(linode) ( x 2 + 1 ) y + 2 x y − cot ( x )
dx
log ( sin ( x ) ) + %c
(%o6)  y =
x2 + 1

 ➔    Solve dy/dx
=
𝒙𝟑+𝒚𝟑 𝒙𝒚𝟐
unit1.wxmx 14 / 14

(%i10) ode:('diff(y,x))−(x^3+y^3)/(x·y^2);
 ode2(ode,y,x); 
d y 3 + x3
(ode) y−
dx x y2
y 3 − 3 x 3 log ( x )
(%o10)  = %c
3 x3

You might also like