I am working on a notebook for my calculus students and am dealing frequently with the norm of vector valued functions. I always seem to run into this kind of situation.
Clear[a, s, r];
r[s_] = {a Cos[s/a], a Sin[s/a]};
T[s_] = r'[s];
κ[s_] = Norm[T'[s]]
Where the output is:
(*Sqrt[Abs[Cos[s/a]/a]^2 + Abs[Sin[s/a]/a]^2]*)
Then I have to bring on the Simplify command to fix the problem. In this case, for example, I do:
κ[s_] = Simplify[Norm[T'[s]], s > 0 && a > 0]
Which provides the same answer students achieve when doing the problem by hand, namely, 1/a.
Am I dealing with the Norm command properly, or would folks like to give better advice?
Update:
Here is an idea that is extremely helpful if you are going to use these assumptions frequently in a large notebook:
Clear[a, s, r];
$Assumptions = a > 0 && s ∈ Reals;
r[s_] = {a Cos[s/a], a Sin[s/a]};
T[s_] = r'[s];
κ[s_] = Norm[T'[s]]
The output is:
(*Sqrt[Abs[Cos[s/a]/a]^2 + Abs[Sin[s/a]/a]^2]*)
But now I can quickly simplify.
Clear[a, s, r];
$Assumptions = a > 0 && s ∈ Reals;
r[s_] = {a Cos[s/a], a Sin[s/a]};
T[s_] = r'[s];
κ[s_] = Norm[T'[s]]//Simplify
The output is:
(*1/a*)
Norm
directly asSqrt[T'[s].T'[s]]
. This doesn't obviate the need for simplifying, although you have one fewer condition to specify. Rather, it merely gets rid of theAbs
. $\endgroup$\[Kappa][s_] = Norm[T'[s]] //Simplify[#, {a > 0, Element[s, Reals]}] &
$\endgroup$