0
$\begingroup$

I am trying to fully simplify the following function using FullSimplfy but I am still getting it with the Sign function. Is there any way to have a simplified one without the Sign function?

expr = 0.00441039 (Sqrt[2 π] Abs[-6 + t]^3 + Sqrt[2 π] Abs[t]^3 + 18.7497 (-1. + t)^3 Sign[1. - 1. t] + 130.745 (-1.5 + 1. t)^3 Sign[1.5 - 1. t] - 896.268 (-2. + t)^3 Sign[2. - 1. t] + 2198.61 (-2.5 + 1. t)^3 Sign[2.5 - 1. t] - 2898.66 (-3. + t)^3 Sign[3. - 1. t] + 2198.61 (-3.5 + 1. t)^3 Sign[3.5 - 1. t] - 896.268 (-4. + t)^3 Sign[4. - 1. t] + 130.745 (-4.5 + 1. t)^3 Sign[4.5 - 1. t] + 18.7497 (-5. + t)^3 Sign[5. - 1. t])

I used the following command:

FullSimplify[expr]
$\endgroup$
3
$\begingroup$

This is a piecewise function.

f = 0.00441039 (Sqrt[2 \[Pi]] Abs[-6 + t]^3 + 
 Sqrt[2 \[Pi]] Abs[t]^3 + 18.7497 (-1. + t)^3 Sign[1. - 1. t] + 
 130.745 (-1.5 + 1. t)^3 Sign[1.5 - 1. t] - 
 896.268 (-2. + t)^3 Sign[2. - 1. t] + 
 2198.61 (-2.5 + 1. t)^3 Sign[2.5 - 1. t] - 
 2898.66 (-3. + t)^3 Sign[3. - 1. t] + 
 2198.61 (-3.5 + 1. t)^3 Sign[3.5 - 1. t] - 
 896.268 (-4. + t)^3 Sign[4. - 1. t] + 
 130.745 (-4.5 + 1. t)^3 Sign[4.5 - 1. t] + 
 18.7497 (-5. + t)^3 Sign[5. - 1. t]);

PiecewiseExpand[f, Reals] // Simplify

enter image description here

Edit: Appendix to your second question: Other form than Piecewise

For real t, you can apply

f2 = f /. Sign[u_] -> u/Sqrt[u^2] /. Abs[u_] -> Sqrt[u^2] // Simplify

enter image description here

But the cases where u==0 are no more defined. There you have to take limit, e.g. Limit[f2,t->1.5] instead of f2/.t->1.5 .

If you want to avoid, that some points are not defined, rationalize the function and apply

f3 = Rationalize[f, 0];

f3 /. Sign[u_] -> u/Sqrt[u^2] /. Abs[u_] -> Sqrt[u^2] // FullSimplify

(*   (1/1000000000000)441039 (-(653725/4) ((3 - 2 t)^2)^(3/2) - 
      5496525/2 ((5 - 2 t)^2)^(3/2) - 5496525/2 ((7 - 2 t)^2)^(3/2) - 
      653725/4 ((9 - 2 t)^2)^(3/2) + 
      10000 Sqrt[2 \[Pi]] ((-6 + t)^2)^(3/2) - 
      187497 ((-5 + t)^2)^(3/2) + 8962680 ((-4 + t)^2)^(3/2) + 
      28986600 ((-3 + t)^2)^(3/2) + 8962680 ((-2 + t)^2)^(3/2) - 
      187497 ((-1 + t)^2)^(3/2) + 10000 Sqrt[2 \[Pi]] (t^2)^(3/2))   *)
$\endgroup$
1
  • 1
    $\begingroup$ Thank you for your comment. Is there any way to write it in the same form of the original function and just without the Sign function? I mean not as the piecewise form. I need to write it in Latex for a nicer view. $\endgroup$ – Mutaz Jun 18 '18 at 4:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.