I was trying to evaluate some intergal over some cube with variable side length, but for some reason Mathematica spit out the input. The interand was sufficiently nice that I couldn't believe it didn't have a closed form solution, moreover it took only a few seconds. I thought my syntax was wrong, so I tried integrating the constant 1. And to my surprise it still does not work. If I substitute the side length with a number it works, but for some reason with some paramenter it doesn't. I try using
Integrate[1, Element[{x, y, z}, Cube[l] ], Assumptions -> l > 0]
and it doesn't work, it just answers with the input. If instead I put a number $n$ it gives the obvious correct answer $n^3$. What is happening?
Integrate[1, Element[{x, y}, Rectangle[-{l, l}, {l, l}]], Assumptions -> l > 0]
andIntegrate[1, Element[{x, y}, Rectangle[-{l, l}, {l, l}]], Assumptions -> l > 0]
andRegionMeasure[Cube[l]]
all work as expected. $\endgroup$Integrate[1,{x,-l/2,l/2},{y,-l/2,l/2},{z,-l/2,l/2}]
Then estimate the amount of your time spent fighting how to do all this abstractly versus the amount of your time spent doing this concretely. $\endgroup$Cuboid
instead.Integrate[1, Element[{x, y, z}, Cuboid[{0,0,0},{l,l,l}] ]] (* l^3 *)
$\endgroup$Volume[Cube[l]]
givesl^3
! $\endgroup$