Formatting LaTeX

How would I use LaTeX to write an equation in the form of:

y = Math.pow(5, 2 * x)

I tried a couple things:

md`${tex`y = 5^2x`}`
md`${tex`y = 5^(2x)`}`

Thanks in advance. - Harry

You’ll want

md`${tex`y = 5^{2x}`}`

See e.g. this page https://www.overleaf.com/learn/latex/Subscripts_and_superscripts

1 Like

Thanks very much. That worked.