Mathematica Giving Me Trouble

106 Views Asked by At

I'm new to mathematica and am just learning the basics. I've run into a few things that I can't figure out.

The first is this:

"Number 11"

$$r[t\_] := \{(1/3)*(t^3), 0.5 * t^2, t\}$$

(*Unit Tangent Vector = $r'/\text{Length}(r')$ *)

$$ta = \frac{r'[t]}{\text{Norm}[r'[t]]}$$

(* Unit Normal Vector = $ta'$/Length($ta'$) *)

$$n = \frac{ta'[t]}{\text{Norm}[ta'[t]]}$$

(* Curvature = Length($ta'$)/Length($r'[t]$) *)

$$c = \frac{Norm[ta'[t]]}{\text{Norm}[r'[t]]}$$

"Number 11"

$$\{t^2/Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4], (1. t)/Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4], 1/Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4]\}$$

.

Derivative[ 1][{t^2/Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4], (1. t)/Sqrt[ 1 + 1. Abs[t]^2 + Abs[t]^4], 1/Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4]}][ t]/Norm[Derivative[ 1][{t^2/Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4], (1. t)/Sqrt[ 1 + 1. Abs[t]^2 + Abs[t]^4], 1/Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4]}][ t]] . Norm[Derivative[ 1][{t^2/Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4], (1. t)/Sqrt[ 1 + 1. Abs[t]^2 + Abs[t]^4], 1/Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4]}][ t]]/(Sqrt[1 + 1. Abs[t]^2 + Abs[t]^4])

I'm not sure how to make it look nice on the forums here sorry. But it's not evaluating the Norm or derivative at some places. It also has a lot of Abs which I don't know if they are totally necessary. How can I get this to to work?

The second one is a problem with taking derivatives.

In[217]:= f[x_, y_, z_] := ((x^2)*(y^3)) + (z^4)

fx = Derivative[1, 0, 0][f][x, y, z]

fy = Derivative[0, 1, 0][f][x, y, z]

fz = Derivative[0, 0, 1][f][x, y, z]

x1[p_] := p + (3*(p^2))

dxdp = Derivative[1][x1][p]

y1[p_] := p*(E^p)

dydp = Derivative[1][x1][p]

z1[p_] := p*Sin[p]

dzdp = Derivative[1][x1][p]

Print["dF/dP:"]

Print[(fxdxdp) + (fydydp) + (fz + dzdp)]

The result:

Out[218]= 32 Sin[t] Sin[2 t]^3

Out[219]= 48 Sin[t]^2 Sin[2 t]^2

Out[220]= 32 Sin[3 t]^3

Out[222]= 1 + 6 p

Out[224]= 1 + 6 p

Out[226]= 1 + 6 p

During evaluation of In[217]:= dF/dP:

During evaluation of In[217]:= 1+6 p+48 (1+6 p) Sin[t]^2 Sin[2 t]^2+32 (1+6 p) Sin[t] Sin[2 t]^3+32 Sin[3 t]^3

Why am I getting Sins and t variables for a derivative of a xy function with no cos or sins? This has happened on multiple problems for me.

Any and all help is welcome! Thanks much!

1

There are 1 best solutions below

0
On

The following seems to work:

r[t_]:={t^3/3,t^2/2,t}
ta[t_]:=Simplify[r'[t]/Norm[r'[t]],Assumptions->Element[t,Reals]]
n[t_]:=Simplify[ta'[t]/Norm[ta'[t]],Assumptions->Element[t,Reals]]
c[t_]:=Simplify[Norm[ta'[t]]/Norm[r'[t]],Assumptions->Element[t,Reals]]

Then ta[t] gives $$ \left\{\frac{t^2}{\sqrt{t^4+t^2+1}},\frac{t}{\sqrt{t^4+t^2+1}},\frac{1}{\sqrt{t^4+t^2+1}}\right\} $$ and n[t] gives $$ \small\left\{\frac{t \left(t^2+2\right)}{\sqrt{\left(t^4+t^2+1\right) \left(t^4+4 t^2+1\right)}},\frac{1-t^4}{\sqrt{t^8+5 t^6+6 t^4+5 t^2+1}},-\frac{2 t^3+t}{\sqrt{\left(t^4+t^2+1\right) \left(t^4+4 t^2+1\right)}}\right\} $$ and c[t] gives $$ \sqrt{\frac{t^4+4 t^2+1}{\left(t^4+t^2+1\right)^3}} $$


If your variables have had values assigned to them, and have not been Cleared, those values will be used. For example, if I have set

x=2Sin[t]
y=2Sin[2t]
z=2Sin[3t]
f[x_,y_,z_]:=((x^2)*(y^3))+(z^4)

then

Derivative[1,0,0][f][x,y,z] returns $32 \sin (t) \sin ^3(2 t)$

Derivative[0,1,0][f][x,y,z] returns $48 \sin ^2(t) \sin ^2(2 t)$

Derivative[0,0,1][f][x,y,z] returns $32 \sin ^3(3 t)$

If I clear the variables with Clear[x,y,z],

Derivative[1,0,0][f][x,y,z] returns $2 x y^3$

Derivative[0,1,0][f][x,y,z] returns $3 x^2 y^2$

Derivative[0,0,1][f][x,y,z] returns $4 z^3$