To elaborate, it also really helps to call simplify prior to computing:
julia> @time ex = integrate(2PI*simplify(h(x)), (x, -r, r))
0.043363 seconds (13.71 k allocations: 715.979 KiB, 9.07% compilation time)
2
4⋅π⋅r
To elaborate, it also really helps to call simplify prior to computing:
julia> @time ex = integrate(2PI*simplify(h(x)), (x, -r, r))
0.043363 seconds (13.71 k allocations: 715.979 KiB, 9.07% compilation time)
2
4⋅π⋅r