To explain, I do most of my probability homework in Mathematica, and use the typesetting built into Mathematica to finish answers. Often, I want to output a function as the answer to a problem, but I want it to be explicit, that is, in the example below, I create a function, X[x,y,z]
, and I want the result to not just display the (in this case) piecewise function, but I want it to define it as a function. As an example:
Clear[X, x, y, z]
X[x_, y_, z_] := Piecewise[{{3/(4*Pi), Sqrt[x^2 + y^2 + z^2] <= 1}}, 0]
X[x, y, z]//TraditionalForm
The output of this is $$ \left\{ \begin{array}{cc} \frac{3}{4 \pi } & \sqrt{x^2+y^2+z^2}\leq 1 \\ 0 & \text{True} \\ \end{array} \right. $$
I want it (the output) to look (something) like
$$ X(x,y,z)=\left\{ \begin{array}{cc} \frac{3}{4 \pi } & \sqrt{x^2+y^2+z^2}\leq 1 \\ 0 & \text{True} \\ \end{array} \right. $$
HoldForm[X[x, y, z]] == X[x, y, z] // TraditionalForm
? $\endgroup$