# Math 21a Fall 2019

## Multivariable Calculus

# Computer algebra issues

Some students have encountered interesting issues with Mathematica. Here something about1) Machine accuracy: (Homework 13, Problem 1)

A=N[(10^10+7)^(0.2),30];B=N[100+7*1/(5*100^4),30]; N[A-B,30] A=(10^10+7)^(1/5);B=100+7*1/(5*100^4);N[A-B,30]The first gives a difference of 10

^{-14}, the second 10

^{-18}. Nothing seems to help, SetPrecision, SetAccuracy, , MaxExtraPrecision, . For example:

SetAccuracy[(10^10+7)^(0.2) - (100+7*1/(5*100^4)),60] SetAccuracy[(10^10+7)^(1/5) - (100+7*1/(5*100^4)),60]2) Some interesting simplification issues in Mathematica. This appeared in Homework 12, problem 5. This code works:

f[t_,x_]:=(1/t)^(3/2)*x*Exp[-(x^2)/(4 t)]/((1/t)^(1/2)*Exp[-x^2/(4 t)]+1); Simplify[D[f[t,x],t]+f[t,x]*D[f[t,x],x]==D[f[t,x],{x,2}]]and the next few lines do not work:

f[t_,x_]:=(1/t^(3/2))*x*Exp[-(x^2)/(4 t)]/((1/t)^(1/2)*Exp[-x^2/(4 t)]+1); Simplify[D[f[t,x],t]+f[t,x]*D[f[t,x],x]==D[f[t,x],{x,2}]]The only change is that

**(1/t)^(3/2)***is replaced by

**(1/t^(3/2))**. Drilling down, one can see that the following expressions are not simplified:

Sqrt[1/t] == 1/Sqrt[t] Sqrt[t^3] == Sqrt[t]^3 Sqrt[1/t^2] == 1/Sqrt[t^2] t^(a*b) == (t^a)^b Sqrt[t^2] == tThe following expressions are simplified and give the value true:

Sqrt[Abs[1/t]] == 1/Sqrt[Abs[t]] t^(3/2) == Sqrt[t]^3 2.5^(a*b) == (2.5^a)^b Sqrt[Abs[t^2]]==Abs[t]What happens is that Mathematica wants to avoid the issue of having a negative argument under the square root.