aboutsummaryrefslogtreecommitdiff
path: root/static/files/posts/mathyd-easy-tex-to-svg/cubic.tex.txt
blob: 6ca948c7adeb0c687110003e8952b618f01fa7a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% solution to ax^3 + bx^2 + cx + d = 0
% https://math.vanderbilt.edu/schectex/courses/cubic/
\begin{align*}
% first term
x &= \sqrt[3]{
  % first term, first subterm
  \left ( \frac{-b^3}{27a^3} + \frac{bc}{6a^2} - \frac{d}{2a} \right ) +

  \sqrt{
    % first term, second subterm
    \left ( \frac{-b^3}{27a^3} + \frac{bc}{6a^2} - \frac{d}{2a} \right )^2 +

    % first term, third subterm
    \left ( \frac{c}{3a} - \frac{b^2}{9a^2} \right )^3
  }
} \\

&+

% second term
\sqrt[3]{
  % first term, second subterm
  \left ( \frac{-b^3}{27a^3} + \frac{bc}{6a^2} - \frac{d}{2a} \right ) -

  \sqrt{
    % second term, second subterm
    \left ( \frac{-b^3}{27a^3} + \frac{bc}{6a^2} - \frac{d}{2a} \right )^2 +

    % second term, third subterm
    \left ( \frac{c}{3a} - \frac{b^2}{9a^2} \right )^3
  }
} \\

&-

% third part
\frac{b}{3a}
\end{align*}