Excercise 5

Derivatives

1. Derivate (x^2) + 4  xwith respect to x

2. Derivate (x^4) + 3  x - sin(x) twice

3. Let the position of a moving body be given by the expression x(t)  =  40 - 5  t - 5  (t^2). What is the position, velocity and the acceleration at t = 2

4. Plot the velocity and position of the previous task in same figure.

4. Does Mathematica know the most common rules for taking derivatives? Find the derivative of

	a.	f(g(x))	(chain rule)
	
	b.	f(x) g(x)	(derivative of a product)
	
	c.	((f(x))/(g(x)))		(derivative of a fraction)
	
5. Let f(x, y) = (x^3) (y^4). Find the partial derivatives

	a. 	∂(f/∂)x, ∂(f/∂)y
	
	b.	(∂^2) (f/∂)(x^2), (∂^2) (f/∂)(y^2)
	
	c.	(∂^2) (f/(∂x ∂y)), (∂^2) (f/(∂y ∂x))

Solution

Clear[
      x]

    D[x^2 + 4  x, x]

  

    D[x^4 + 3  x - Sin[x], {x, 2}] 

    D[x^4 + 3  x - Sin[x], x, x] 

    D[D[x^4 + 3  x - Sin[x], x] , 
      x]   

  

    Clear[t]

    x[t_] = 40 - 5  t - 5  t^2

    {x[t], D[x[t], t], D[x[t], t, t]}

    % /. t -> 2   

    Clear[x]

  

    Clear[f, g]

    D[f[g[x]], x]

    D[f[x] g[x], x]

    D[f[x]/g[x], x] // Together   

  

    Clear[y]

    f = x^3 y^4

    D[f, x]

    D[f, y]

    D[f, {x, 2}]

    D[f, {y, 2}]

    D[f, x, y]

    D[f, y, x]

    Clear[f]

Total differential

1.

1. Find the total differential of F(x, y, z) = x y + (z^2) x + y (z^3)

2. Find the total differential of \(TraditionalForm\`G(
          r, \ θ, ϕ) = \(1\/r\^2\) \(sin(θ)\) \(cos(ϕ)\)\).

3. Find the total derivative of F(x,  y) = (Sqrt[(x^2) + (y^2)]),  x = x(t),  
      y = y(t),  with respect to t

Solution

Clear[F, x, y, 
      z]

    F = x y + z^2 x + y z^3

    Dt[F]

    Clear[F];

  

    Clear[G, r, q, f]

    G = r^(-2) Sin[q] Cos[f]

    Dt[G]

    Clear[G];

  

    F = (Sqrt[(x^2) + (y^2)])

    Dt[F, t]   

    F = (Sqrt[x[t]^2 + y[t]^2])

    D[F, t]

    Clear[F];

2.

Let U(S, V, N) = T S - p V + μ N. 

1. Find the total differential of U. 

2. Find the partial derivative ∂(U/∂)Sand ∂(U/∂)V 

3. Find the total derivatives d(U/d) Sand d(U/d)V 

4. Take the total differential of U and set the differentials with respect to T,  p and μ to zero.

Solution

Clear[U, S, V, n, mu]
U = T S - p V + mu n;
  
Dt[U]
  
D[U, S]
D[U, V]
  
Dt[U, S]
Dt[U, V]
  
Dt[U] /. {Dt[T] -> 0, Dt[p] -> 0, 
        Dt[mu] -> 0}
  
Dt[U, 
      Constants -> {T, p, 
          mu}]

Clear[U];

3.

1. Sven-Erik finds a mysterious metal sphere on his lawn. He measures the radius of the sphere three times, and gets as results r = 12.0,  12.1,  11.8 centimeters. Find the volume of the sphere V = (4/3) π (r^3) and the error limits.

2. Let's assume that the number of monkeys at a zoo depends on the number of bananas and the weight of a monkey according to the following formula: m[banana_,weight_]=3*banana/weight. Calculate the number of monkeys and the error limits when there are 100 ± 5 kg of bananas and one monkey weighs 7.3 ± 1.2 kg!

Solution

1. Mysterious Sphere

Clear[V, r]
rData = {12.0, 12.1, 11.8}
rMean = Mean[rData]
  
rDelta = Max[rData] - Min[rData] 
V[r_] = (4/3) π (r^3)
  
VMeas = V[rMean]
VDt = Dt[V[r]]
VDelta = Abs[VDt]
  
VErr = 
      VDelta /. {r -> rMean, 
          Dt[r] -> rDelta}
\(\(Print["Volume is ", \ VMeas, \ " ± ", \ 
        VErr, \ \*"" \!\(cm\^3\)""];\)\)
Clear[rData, rMean, rDelta, V, VMeas, VDelta, VDt]

2. Monkeys!

Clear[m, b, w]
bn = 100;    
bdn = 5;    
wn = 7.2;   
wdn = 1.2;  
m[b_, w_] = 2  b/w
  
monkeys = m[bn, wn] ;
  
Dt[m[b, w]] 
  
mdelta = Abs[%[[1]]] + Abs[%[[2]]] 
  
mdn = 
      mdelta /. {b -> bn, w -> wn, Dt[b] -> bdn, 
          Dt[w] -> wdn}
  
Print["Zoo has ",  monkeys,  " ± ",  
      mdn,  " monkeys!"]