# How to make Mathematica Simplify?

Let us define

r1 = 1;r2 = 2;


and

beta2[t_] := {r1*Cos[2*Pi*t], r2*Sin[2*Pi*t]}
beta1[t_] := beta2[t + 4.8*t^2*(t - 1)^2]
k[v_] := If[Norm[v] > 0, v/Sqrt[Norm[v]], 0]


with

q2[t_] :=  FunctionExpand[k[beta2'[t]], Assumptions -> t \[Element] Reals]

q1[t_] :=  FunctionExpand[k[beta1'[t]], Assumptions -> t \[Element] Reals]


Now when I call

 q1'[3]


I get

{4.56985 + 0.157049 (10.2293 Derivative[1][Abs][-5.97566] - 40.9174 Derivative[1][Abs][-3.88322]), -28.1291 + 0.102057 (10.2293 Derivative[1][Abs][-5.97566] - 40.9174 Derivative[1][Abs][-3.88322])}

Question

How to simplify this expression?

• Apply FunctionExpand to the final expression to simplify it. Sorry, I didn't follow the rest of the code ... Commented Mar 29, 2014 at 20:34
• You can't take derivative with respect to a number. so not sure what q1'[3] is meant to represent. Also, If[Norm[v] > 0, v/Sqrt[Norm[v]], 0] return the result you show, since it is passed a symbolic expression. You are mixing symbolic with numerical computation in strange way. Commented Mar 29, 2014 at 23:40

Generally speaking, If is for programming and Piecewise is for function construction. While the distinction is somewhat artificial, the significant difference is that Piecewise, although having the attribute HoldAll, evaluates its arguments. The effective difference can been seen by evaluating q1[t] with the OP's definition of k[v] and this one:
k[v_] := Piecewise[{{v/Sqrt[Norm[v]], Norm[v] > 0}}]

With this definition, FunctionExpand works properly to expand the instances of Abs that show up when Norm is evaluated. The OP's test example works properly with this change:
q1'[3]