Symbolic Manipulation of Piecewise Functions

Throughout Mathematica, piecewise functions are now automatically supported in symbolic operations. Mathematica supports traditional 2D formatting of piecewise definitions, for both output and input.

D[ Max[x,  (x^2)],  x ]

Note: //TraditionalForm automatically converts output to TraditionalForm.

D[Max[x, (x^2)], x] // TraditionalForm

Piecewise Integrals

Piecewise functions work with domain specification in Mathematica enabling close-form solutions to a broad range of problems.

Assuming[
      x ∈ 
        Reals, ∫Abs[2 - Abs[x]] \[DifferentialD]x]

Solving an Equation with Piecewise Elements

This differential equation involves two piecewise functions: the UnitStep θ and Max.

DSolve[Max[t, (t^2)] y[t]+y'[t]==UnitStep[t]&&y[0] == 1,y[t],t]

Example: Expanding Piecewise Definitions

PiecewiseExpand[Mod[(x^2), Ceiling[x]], 1 < x < 3]