I need to integrate integrals of the type
Integrate[Boole[2 k*q >= Absolute[p^2 - k^2 - q^2]], q]
where $q$, $k$, and $p$ go from $0$ to $1$.
To learn to interpret the Mathematica output what I first evaluated (as a test) was
Integrate[Boole[2 k*q > (p^2 - k^2 - q^2)], {q, 0, 1},
Assumptions -> 0 < k < 1 && 0 < p < 1]
Performing the integral by hand I find $1-{\rm max}(0,p-k)$ as a result. The Mathematica result yields the following piecewise function
\begin{cases} 1 & 0 < k < 1\mathtt{\;\&\&\;}p > 0\mathtt{\;\&\&\;}k-p \ge 0\\ 1 + k - p & \mathtt{True} \end{cases}
OK, the first line of the output I can interpret as a new Heaviside function which tells me that $k\geq p$ but what does the second line of the output try to tell me? Is there a convenient way to transform the piecewise output into $\min$, $\max$ functions or construct new Heaviside functions?
Piecewise
expression backwards: this is telling you that, for $k \ge p$, the value of the integral is $1$; in all other cases, the integral has the value corresponding to theTrue
condition, i.e. $1+k-p$ in this case. Notice also that you can have MMASimplify
your conditions: tryAssuming[{0 < k < 1, 0 < p < 1}, Simplify@Integrate[Boole[2 k q >= p^2 - k^2 - q^2], {q, 0, 1}]]
. $\endgroup$ – MarcoB Jan 27 '17 at 22:43True
means that the following expression is true for all cases not mentioned in the above conditions but still I wonder if one can transform such piecewise expressions into other expressions like max,min functions or new boole functions automatically? Or do I have to go through the mathematica expressions by hand to create those functions? $\endgroup$ – Rico Jan 27 '17 at 23:04Simplify`PWToUnitStep[%]
? $\endgroup$ – Michael E2 Jan 28 '17 at 2:51