Professional Documents
Culture Documents
Department of Mathematics
Name:
Roll Number:
Section:
1. Limit
"dir" - (default: None); dir may have the value 'plus' (or '+' or 'right' or 'above') for a limit from above,
'minus' (or '-' or'left' or 'below') for a limit from below,
or
may be omitted (implying a two-sided limit is to be computed).
x
Problem: Find the limit of lim x → 0 | x |
plot(f(x),(x,-2,2),figsize=3)
In [ ]: limit(f(x),x=0)
Problem:
x2 − 4
Evaluate lim x → 2 x−2
In [ ]: plot((x^2-4)/(x-2),0,4,figsize=3)
In [ ]: limit((x^2-4)/(x-2),x=2)
Problem:
In [ ]: var('a')
In [ ]: assume(a>0)
In [ ]: limit(x^a,x=infinity)
In [ ]: forget()
In [ ]: assume(a<0)
In [ ]: limit(x^a,x=oo)
Exercise 3.1
Solution 1
In [ ]:
Solution 2
In [ ]:
2. Derivatives
diff(f, args)
In [ ]: f(x)=x*sin(1/x)
Problem:
2
Consider a function f(x) = sin(cos(5x)) − e ( x − a ) . Plot the graph of f(x) along with first two derivative in [0.5, 2].
In [ ]: p = plot(f(x),0.5,2,color='red')
p1 = plot(f1(x),0.5,2,color='green')
p2 = plot(f2(x),0.5,2,color='black')
show(p+p1+p2, ymax=20,ymin=-30,figsize=5)
Exercise 3.2
1. Find the first four derivatives of f(t) = ln(1 + t 2) and plot them along with the graph of f(t).
Solution 1
In [ ]:
Solution 2
In [ ]:
3. Partial Derivatives
xy ∂f ∂f ∂ 2f ∂ 2f ∂ 2f ∂ 2f
For f(x) = find , , , , ,
x+y ∂x ∂y ∂x 2 ∂y 2 ∂x∂y ∂y∂x
In [ ]: var('x,y')
f(x,y) = (x*y)/(x+y)
show(fx(x,y))
show(fy(x,y))
fxx=f.diff(x,2) # Gives Second order derivative of f with respect to x . Instead of fxx we can give any other name a
lso.
show(fxx(x,y))
fyy=f.diff(y,2) # Gives Second order derivative of f with respect to y . Instead of fyy we can give any other name a
lso.
fxy=f.diff(x,y) # Here we are differentiating function first with respect to x and then we differentiate the result
with respect to y.
show(fxy(x,y))
fyx=f.diff(y,x) # Here we are differentiating function first with respect to y and then we differentiate the result
with respect to x.
show(fxy(x,y))
Problem:
2 − y2 )
For f(x) = f(x, y) = 4xye ( − x , find all first order and second order derivatives at point (1,2).
In [ ]: var('x,y')
f(x,y)=4*x*y*exp(-x^2-y^2)
show(f(x,y))
In [ ]: f.diff(x,y)(x=1,y=2) # Gives Derviative of f first with respect to x and then with respect to y at (1,2).
In [ ]: f.diff(y,x)(x=1,y=2) # Gives Derviative of f first with respect to y and then with respect to x at (1,2).
Exercise 3.3
∂ 2f ∂ 2f
1. Let f(x, y) = ln(x 2 + y 2). Show that + = 0.
∂x 2 ∂y 2
2. Find all the first order partial derivatives of w = x 2y − 10y 2z 3 + 43x − 7tan(4y)
Solution 1
In [ ]:
Solution 2
In [ ]:
4. Implicit Derivative
dy
Find the slope formula for the Folium of Descartes implicitly defined by x^3 + y^3 = 6xy.( Find dx
)
In [ ]: x = var('x')
y = var('y')
y=function('y')(x)
temp=diff(f(x,y))
solve(temp,diff(y))
Exercise 3.4
dy
1. Find the dx
for the implicit function 2(x 2 + y 2) 2 = 25(x 2 − y 2).
dy
2. Find the for the implicit function y 2 = x 3(2 − x).
dx
Syntax for finding local maximum value of function f(x) in interval (a, b) is
f.find_local_maximum(a,b).
Syntax for finding local minimum value of function f(x) in interval (a, b) is
f.find_local_minimum(a,b).
Problem:
2
Find the local maximum and local minimum of the function f(x) = e − x / 2 + e − 2x .
f.plot(-2,2,figsize =4)
In [ ]: f.find_local_maximum(-1,1)
In [ ]: f.find_local_minimum(-1.5,-0.5)
In [ ]: f.find_local_minimum(1,2)
In [ ]: f.find_local_minimum(-1.5,-0.5)
In [ ]: f.find_local_maximum(1,2)
In [ ]: plot(f.diff(),-2,2,figsize=4)
In [ ]: c1 = f.diff().find_root(-2,-0.5)
c1
In [ ]: c2 = f.diff().find_root(-0.5,0);c2
Problem:
pf = plot(f,0,3)
show(pf,figsize=4)
In [ ]: df = f.diff()
d2f = f.diff(2)
cpts
In [ ]: c = infl[0][x]
In [ ]: pf = plot(f,0,3,thickness=0.5)
pdf = plot(df,0,3,thickness=0.5,color='red')
pd2f = plot(d2f,0,3,thickness=0.5,color='black')
show(pf+pt1+pt2+pt3+pdf+pd2f,ymin=-5,ymax=8,figsize=4)
Problem:
The Hubble Space Telescope was deployed on April 24, 1990, by the space shuttle Discovery. Amodel for the velocity of the shuttle during this
mission, from liftoff at t = 0 until the solid rocket boosters were jettisoned at t = 126 seconds, is given by
(in feet per second). Using this model, estimate the absolute maximum and minimum values of the acceleration of the shuttle between liftoff and
the jettisoning of the booster.
In [ ]: var('t')
v(t) =0.001302*t^3-0.09029*t^2+23.61*t-3.083
In [ ]: plot(v,0,126,figsize=4)
In [ ]: a = v.diff()
a.plot(0,126,figsize=4)
In [ ]: a.find_local_minimum(0,126)
In [ ]: a.find_local_minimum(0,126)
Exercise 3.5
3
BL 2
P = Av +
v
where A and B are positive constants specific to the particular aircraft and L is the lift, the upward force supporting the weight of the plane. Find
the speed that minimizes the required power.
Solution 1
In [ ]:
Solution 2
In [ ]:
Solution 3
In [ ]:
In [ ]:
Loading [MathJax]/jax/output/HTML-CSS/jax.js