I don't want to write


all the time in my expressions.

I can't write

μ[0] = UnitConvert[Quantity["MagneticConstant"]]

because Mathematica doesn't treat subscripted variables in the same way as simple ones. Neither can I write

mu_0 = UnitConvert[Quantity["MagneticConstant"]]

Any suggestions?

  • 7
    $\begingroup$ I would use mu0. $\endgroup$ Commented Jun 21, 2020 at 10:46
  • $\begingroup$ Maybe try inline free-form input, Insert > Inline Free-form input and just type "magnetic constant" or "hbar" or "speed of light" or whatever you want, exit the little box and it should automatically figure out what constant you mean. $\endgroup$
    – imas145
    Commented Jun 21, 2020 at 10:47
  • $\begingroup$ The Notation package allows you to define subscripted variables. $\endgroup$
    – mikado
    Commented Jun 21, 2020 at 15:34
  • 4
    $\begingroup$ Mathematica will accept μ0 as an identifier. $\endgroup$
    – m_goldberg
    Commented Jun 22, 2020 at 15:28
  • $\begingroup$ $Post might be useful for you as well. $\endgroup$
    – chuy
    Commented Jun 22, 2020 at 16:41

1 Answer 1


Subscripts can be added with Ctrl - (Cmd - on Mac), or via the Basic Math Assistant palette. Mathematica will then recognise $\mu_0$ as a variable.

The same can be achieved with Subscript[μ,0]=UnitConvert[Quantity["MagneticConstant"]] so you can easily create an array of constants with subscripts.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.