Quick example using mathjax
:
Load the cdn: (make sure to specify a ?config=
option as it doesn't come included in the recommended cdn link - default
works just fine):
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=default'></script>
Then, inside your html simply wrap the equation inside $$ {equation here} $$
e.g. $$ {J(\theta) =\frac{1}{2m} [\sum^m_{i=1}(h_\theta(x^{(i)}) - y^{(i)})2 + \lambda\sum^n_{j=1}\theta^2_j} $$
And it should show up as an equation just fine on the page.