# Dealing with exponents that contain units?

Many of the equations I deal with involve powers of quantities which contain units. However, when the exponent contains units (e.g., E^Quantity[3, "Joules"]), Mathematica will not evaluate it "fully." For example, This stays unevaluated. On some level, it makes sense, but I'd like to be able to get a numerical value to this without having to remove the units beforehand. Is there any way to do this?

I would also totally be okay with a solution that allows it to evaluate without taking into account the units (i.e., by ignoring them). I'm just trying to avoid removing the units manually from each quantity.

• what is R above? Better post plain text minimal Mathematica code that shows the problem that one can copy (ok to post images, but also need the code itself). May be you need to use QuantityMagnitude on these? May 1 at 1:21
• As Nasser suggested already, people here expect the code to be posted in a form that is easy to copy and paste. Please, edit your post and include the code in an appropriate format. Thanks and welcome to Mma.S.E.
– bmf
May 1 at 1:54
• Arguments to exponential functions (probably all transcendental functions) should be dimensionless. E.g. $e^{1 \text{m}} \ne e^{100 \text{cm}}$. I don't think I'd trust a model that said I needed to compute E^Quantity[3, "Joules"]. Another example: $dy/dx = y$ implies $x$ is dimensionless and not Joules. May 1 at 2:24
• To elaborate a bit on Michael E2's comment, the E^x can be expanded in a power series: 1 + x + x^2 +x^3 +... Each term has a different unit, and you can't add things having different units sensibly. If x were a length, the first term is a number, added to a length, added to an area, added to a volume etc. The sum makes no sense. So there seems to be a more basic problem with what you're doing and the exponents do indeed need to be dimensionless.
– user87932
May 1 at 2:25
• Inhomogenous functions wrt. physical units are mathematical objects in the space of powers of the units, E.g (1 - 1 Volt) lives in (Real, Real* V), and its inverse (1- 1V)^-1 = sum V^n live in space of all V^n. In physics, expressions have a common momial of units. If a number and a unit are added, you can be absolutely sure, that the number has the same monomial of units. Except for Numerology. Planck succeded in numerology by introducing a fictional constant "h" of dimension time*energy in order to give e^(time * energy) the mathematical sense e^(time * energy / h). See tensor calculus. May 1 at 8:22

E^Quantity[3., "Joules"] /. Quantity[x_, _] :> x

20.085536923187668