Thứ Bảy, 16 tháng 12, 2017

How to type Math formula in blog

We may use Matjax from https://www.mathjax.org
Adding the snippet to your page:
Theme => Edit HTML =>
<head>
  <script type="text/javascript" async
  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
</head>

For example:
(1)
$$\sum_{i=0}^{\infty} \frac{x^i}{i!} = \lim\limits_{n\to\infty}\prod_{i=1}^{n}(1+a_{i}x) = \int\limits_{-\infty}^{x} e^y dy = e^x$$
(2)
$$x\in\mathbb{N}\Rightarrow\exists y\in\mathbb{N}\colon y=x+1$$(3)
$$\forall x\in\mathbb{R}, \exists y\in\mathbb{R}\colon x+y=0 \quad \nexists y\in\mathbb{Q}\colon y^2=2$$
(4)When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$Or you may love using Online LaTeX formula editor and browser-based math equation editor
http://hostmath.com/
Another source:How-do-you-use-LaTeX-mathematical-on-Quora?

Another example:
What is the solution of the differential equation 
$$(\frac{dy}{dx})^2 + 4y\frac{dy}{dx}tan{x} + 4y^2sec^2{x} = cos^6{x} + 4{y}^2 $$

Let see how the problem will be solved by Yebraw Mada, studies Mathematics and Physics at University of Bristol (2021)
What a horrific looking equation. This may take some time to solve…
After a while of pondering I’ve realized that this is actually quite a lot simpler than it looks. We just need to rearrange the fuck out of it. Here goes:

We start with
$$(\frac{dy}{dx})^2+4y\frac{dy}{dx}tan{x}+4y^2sec^2{x}=cos^6{x}+4y^2$$
Let’s subtract the \(4y^2\), giving us
$$(\frac{dy}{dx})^2+4y\frac{dy}{dx}tan{x}+4y^2sec^2{x}-4y^2=cos^6{x}$$
Now factorizing
$$(\frac{dy}{dx})^2+4y\frac{dy}{dx}tan{x}+4y^2(sec^2{x}-1)=cos^6{x}$$
Now remembering our trig identities this becomes
$$(\frac{dy}{dx})^2+4y\frac{dy}{dx}tan{x}+4y^2tan^2{x}=cos^6{x}$$
The next step is to multiply by \(cos^2{x}\)
$$cos^2{x}(\frac{dy}{dx})^2+4y\frac{dy}{dx}sin{x}cos{x}+4y^2sin^2{x}=cos^8{x}$$
It is not so obvious to spot the next step, but notice that the LHS factorizes perfectly.
$$(\frac{dy}{dx}cos{⁡x}+2ysin{⁡x})^2=(cos^4{⁡x})^2$$
Note that here I will just focus on the positive square root of each side. The next method will apply for the negative values too.
$$\frac{dy}{dx}cos{x}+2ysin{x}=cos^4{x}$$
Dividing through by \(cos{x}\)
$$\frac{dy}{dx}+2ytan{x}=cos^3{x}$$
Now we solve using an integrating factor. Here it is
$$e^{\int{2tan⁡{x}d{x}}}$$
$$e^{2lnsec{x}}$$
$$sec^2{x}$$
Now multiplying by this integrating factor we get
$$\frac{dy}{dx}sec^2{x}+2ysec^2{x}tan{x}=sec^2{x}cos^3{x}$$
$$\frac{d}{dx}(ysec^2{x})=cos{x}$$
We eventually end up with
$$y=cos^2{x}(sinx+C)$$
Phew. That was tiring. This solution can then be checked by substituting it back into the original differential equation.
Thanks for the A2A!

Không có nhận xét nào:

Đăng nhận xét