he actually, corrects it in the very next line while dividing by (1 + i) (1 + i)(-1 -3i) = - 1 - 3i - i + 3 = 2 -4i So, he did write it the wrong way and as he followed his own script he gets to the right path to the solution 👍🏻 You've got a good eye tho
I was actually waiting for this issue to bite him so he had to correct himself later, but instead he just copied from his notes for the next line. 'Who wants to watch me divide a whole bunch of terms by 1+i?' Oh I would have liked to see you find the error later and self correct.
OK good, I was watching that and I noticed it too, but I figured I was missing something since there was a lot of i floating around and I assumed maybe there was some cancellation going on. But nope, The sign just got flipped the wrong way. :^)
6:30 and the rest is left as an exercise for the reader. 7:00 "and we just plug this into the analytic solution for a 4th order polynomial" rofl yeah right. that equation occupies 3 pages in Abramowitz & Stegun 7:10 which he admits, with a big grin 7:55 any math prof who is able to incorporate an "among us" reference into his lectures is in my good books. very nicely done
I used a more classical approach using basic trigo formulas Define cos = x From cos²+sin² = 1 sin = sqrt(1-x²) From tan=sin/cos tan = sqrt(1-x²)/x Then cos+sin+tan = 2 can be rewritten as x+sqrt(1-x²)+sqrt(1-x²)/x = 2 Multiply by x x²+x*sqrt(1-x²)+sqrt(1-x²) = 2x Isolate the sqrt -x²+2x = (x+1)*sqrt(1-x²) Square both sides (-x²+2x)² = (x+1)²*(1-x²) Develop and simplify to get the following quartic equation 2x⁴ - 2x³ + 4x² - 2x - 1 = 0 An online quartic equation calculator then gave me 2 real solutions: -0.294096415633 and 0.848926885181 Since x=cos , the final solutions are arccos(-0.294096415633) = ±1.8693 arccos(0.848926885181) = ±0.5568 And of course, each solution has to be tested to figure out the proper sign.
Yes, it's bizarre that he doesn't work with cos and stick to polynomials over the reals. There's no good reason to decide to work with e^{ix} and do everything over the complex numbers. Also, it seems like a really uninteresting problem! Why the 2 in the initial equation? Maybe it came out of a real life computation that turned up in something. I did it your way and was expecting the quartic for cos(theta) to be factorisable into the product of two quadratic polys or something, to give a nice solution for cos, but no - it's irreducible over the rationals. Furthermore, the quartic poly for cos actually has full Galois group S_4 over the rational numbers meaning that the theta isn't a rational multiple of pi (in radians) or a rational number (in degrees). You can't even say at the end, something like "and so the argument of the sin,cos and tan functions that gives a solution of this equation is 35 degrees" - it's some transcendental number which isn't a rational multiple of pi if you are working in radians and I think probably a transcendental number if you are working in degrees. Pretty pointless really. Here's some random problem that leads to a GENERAL quartic polynomial over Q which I can't write down a nice solution to but for which you can use generic methods to get approximations to, just like you could with any other quartic polynomial.
No need to invoke the complex representations of the functions... as already others have pointed out. My method: First notice that cos(x) = 0 obviously gives no solution, hence it's no problem to multiply the equation with that, resulting in cos²(x) + sin(x) cos(x) + sin(x) = 2 cos(x). Isolating the terms with sin on the left hand side gives sin(x) (cos(x) + 1) = cos(x) (2 - cos(x)) Squaring both sides and then using sin²(x) = 1 - cos²(x) gives (1 - cos²(x)) (cos(x) + 1)² = cos²(x) (2 - cos(x)), and this then results in a quartic equation for cos(x). Using Wolfram Alpha or something similar), cos(x) \approx -0.29410 and cos(x) \approx 0.84893. Both give two solutions, and plugging these four solutions into the original equation shows that only the two -1.8693 and 0.5568 are really valid solutions.
I went as far as rewriting in terms of sin and eliminating the square roots but I couldn't see any 'trick' to factor the quartic. Then I watched the video. Only thing interesting here is writing it in exponentional form to side step (hide?) the radicals. As far as solving it numerically just use the original equation. Easy to see that if the angle is 0 the sum is 1. If 90 deg the sum is infinity. Try 45 deg sum 2.4142 too high try 30 deg sum 1.9433 too low try 37 deg sum 2.1540 try 33 deg sum 2.0327 try 32 deg sum 2.0028367 try 31.5 deg sum 1.9879395 try 31.8 deg sum 1.99032138 try 31.9 deg sum 1.999855202 try 31.95 deg sum 2.00134582 try 31.92 deg sum 2.00045142 try 31.91 deg sum 2.00015330 try 31.905 deg sum 2.00000425 12 quick calculations using windows calculator.
That's how I did it too. It's not very difficult. If c is cos(x) you find that c is one of two roots of c^4-3c^3+5c^2-c-1. There are 2 false solutions because of squaring that is done along the way.
@@jimskea224 the polynomial should be 2c⁴ - 2c³ + 4c² - 2c - 1. graphing this function with sin(x) + cos(x) + tan(x) - 2 shows that, in [0, 2π), their zeros match up with the polynomial having 1 extraneous solution.
My first thought is you do polynomial division on the quartic, where you divide by the factor (z-a)(z-b), with a and b the unknown unit circle roots. Then solve the resulting quadratic to get the roots we don't want, and then do polynomial division again to get the quadratic for the roots we do want. This sounds like hell though!
6:31 there is symmetry in the coefficients when interchanging real and imaginary parts. Would that be a hint towards an analytical solution of the polynomial?
2 ปีที่แล้ว +1
I thought this symmetry was just due to the fact that the conjugate of z was 1/z, but indeed we can exploit it much further. Dividing by z^2 we get P(z) + i bar(P(z)) = 0 as interchanging real and imaginary parts is equivalent to taking the conjugate (that's what bar means, note that bar(z) = 1/z here) and multiplying by i, where P(z) = z^2 + (-1-3i) z + 1. However if Z is a complex number, one has Z + i bar(Z) = 0 if and only if Re(Z) + Im(Z) = 0 which is equivalent to Z = a (1-i) where a is real. Thus P(z) divided by 1-i is real meaning that P(z) (1+i) is real. Let's write z = a + ib. We then get (a^2 - b^2 + 2aib - a + 3b - i(3a+b) + 1)(1+i) is real i.e. a^2 - b^2 + 2ab - 4a + 2b + 1 = 0. We thus get a quadratic equation depending on a so we get a = 2 - b pm sqrt(2b^2 - 6b + 3), where pm is plus or minus. By replacing z by z = 2 - b pm sqrt(2b^2 - 6b + 3) + ib in the original equation we may continue with just b to be determined.... But at least, you can check all the solutions he magically gave at the end have that form for z 😉
I think this is the first and only TH-camr I have ever seen who says “thanks for watching” at the beginning, not the end, of every video. It’s interesting, and also really nice! Epic content as usual Dr πm.
9:25 Another way to discard two of the possible solutions is Euler's formula. For z= exp(ix)= 0.04 + 0.32i, cosx = 0.04, sinx = 0.32, so tanx= 8. So their sum is greater than 2. The case z= exp(ix)= 0.4 + 3.11i, is impossible since sinx cannot be greater than 1, for real x.
If you're going to use numeric methods, you might as well just look for the two principal solutions to sin(x)+cos(x)+tan(x)=2 directly. A couple of minutes with ten rows of a spreadsheet starting at 0.5 with increments of 0.01 and successively refining them gives 0.556844808 and then starting at -2 with increments of -0.01 gives -1.869306314. it's ridiculously crude and algorithmically inefficient, but much faster than than deriving and solving a fourth order polynomial with complex coefficients. Of course, the Weierstrass substitution also gives a fourth order polynomial in t with rational coefficients that you can solve for t=tan(x/2), but that still needs numeric solutions in the practical case.
...Good day Dr. Peyam, This was a wonderful and enjoyable demonstration of all-round math skills, and instead of Tau I would, if I was in charge, give you the Nobel Prize for making mathematics accessible to a wide audience, even for me with my limited knowledge. Je vous remercie beaucoup, Jan-W p.s. Ma première action en essayant de résoudre le problème á également été de créer un graphique comme vous pour un peut plus de clarté sur le problème en question!
If you were going to resort to a numerical solver anyway, you might as well just apply Newton's formula to the function f(x)=cos(x)+sin(x)+tan(x)-2. Starting with x=0, in just 3 iterations you already get x=0.5568448. Starting with x=-2 gives the negative solution. It's not clear to me why going to a quartic equation first is any more "enlightening".
And if you do want to solve it purely algebraically, it seems far simpler to avoid complex numbers: if you let c=cos(x), then as another commenter pointed out you quickly get the nicer equation 2c^4 - 2c^3 + 4c^2 - 2c - 1 = 0. Grinding through the quartic formula gives solutions as follows: define t = (1/12)*(334+54*sqrt(41))^(1/3) + (1/12)*(334-54*sqrt(41))^(1/3) - 13/24 and then the real solutions are given by c = sqrt(t/2) +/- sqrt(-t/2 - 13/16 + 1/(16*sqrt(2t))) + 1/4.
@@jimskea224 Let s=sin(x) and c=cos(x), so the equation is c+s+s/c = 2. Rearranging gives s(c+1) = c(2-c). Square both sides and get (1-c^2)(c+1)^2 = c^2(2-c)^2 (1-c^2)(c^2+2c+1) = c^2(4-4c+c^2) -c^4-2c^3+2c+1 = c^4-4c^3+4c^2 and then this gives the equation 2c^4-2c^3+4c^2-2c-1 = 0.
Real number approach We know that slope of the line is tan(a) so slope of angle bisector is tan(a/2) Let's follow the steps of construction sin(a)x - cos(a)y = 0 y = 0 Let vertex B of divided angle has coordinates (0,0) Now we choose point on the one of the rays arbitrarily Let it be D = (1,sin(a)/cos(a)) We need isosceles triangle so we need circle in this approach |BD|^2 = (1 - 0)^2 + (sin(a)/cos(a))^2 |BD|^2 = 1 + sin^2(a)/cos^2(a) |BD|^2 = cos^2(a)/cos^2(a) + sin^2(a)/cos^2(a) |BD|^2 = (cos^2(a) + sin^2(a))/cos^2(a) |BD|^2 = 1/cos^2(a) |BD| = 1/cos(a) x^2 +y^2 = 1/cos^2(a) We write system of equations x^2 +y^2 = 1/cos^2(a) y=0 x^2 = 1/cos^2(a) y = 0 (x^2 - 1/cos^2(a))=0 y = 0 (x - 1/cos(a))(x + 1/cos(a))=0 y = 0 Now we choose point E = (1/cos(a) , 0) We have vertices of isosceles triangle, line perpendicular to DE passing through point B divides this triangle int two congruent right triangles Equation for line perpendicular to AB passing through point C is y - yC = -(xB - xA)/(yB - yA)(x - xC) y - 0 = -(1/cos(a) - 1)/(0 - sin(a)/cos(a))(x-0) y = -(1/cos(a) - 1)/(0 - sin(a)/cos(a))x y = -(1/cos(a) - 1)/(- sin(a)/cos(a))x y = (1/cos(a) - 1)/( sin(a)/cos(a))x y = (1/cos(a) - cos(a)/cos(a))/( sin(a)/cos(a))x y = ((1-cos(a))/cos(a))/( sin(a)/cos(a))x y = (1-cos(a))/sin(a) x tan(a/2) = (1-cos(a))/sin(a) (1-cos(x))/sin(x) = y ysin(x) = 1-cos(x) y^2sin^2(x) = (1-cos(x))^2 y^2(1-cos(x))(1+cos(x)) = (1-cos(x))^2 y^2(1+cos(x)) = (1-cos(x)) y^2 = (1-cos(x))/(1+cos(x)) y^2 = (2-(1+cos(x)))/(1+cos(x)) y^2 = 2/(1+cos(x)) - 1 y^2+1 = 2/(1+cos(x)) (1+cos(x))/2 = 1/(y^2+1) 1+cos(x) = 2/(y^2+1) cos(x) = 2/(y^2+1) - 1 cos(x) = (2-1-y^2)/(1+y^2) cos(x) = (1 - y^2)/(1+y^2) 1-cos(x) = 1 - (1 - y^2)/(1+y^2) 1-cos(x) = ((1+y^2 ) - (1 - y^2))/(1+y^2) 1-cos(x) = 2y^2/(1+y^2) sin(x) = 1/y * 2y^2/(1+y^2) sin(x) = 2y/(1+y^2) tan(x) = (2y/(1+y^2))/((1-y^2)/(1+y^2)) tan(x) = 2y/(1 - y^2) So we have equation 2y/(1+y^2) + (1 - y^2)/(1+y^2) + 2y/(1 - y^2) = 2 2y(1-y^2) + (1-y^2)^2+2y(1+y^2) = 2(1-y^2)(1+y^2) 2y(1-y^2 + 1+y^2) + (1-y^2)^2 = 2(1-y^2)(1+y^2) 4y +(1-y^2)^2 = 2(1-y^4) 4y + (1-y^2)^2 + 2(y^4 - 1) = 0 (y^4-2y^2+1)+2y^4 - 2 + 4y = 0 3y^4 - 2y^2 + 4y - 1 = 0
Real solutions are 2arctan(y_{1})+2kπ , 2arctan(y_{2})+2kπ Two other series of solutions might be complex I solved my quartics with real coefficients from scratch but expressed solution in terms of p where p is the root of follownig polynomial p^3+2p^2+12p-24 I used Ferrari method because for me it is the most comfortable in computations (It also requires the least computations among all the methods I know) In Ferrari method you express quartic as a difference of two squares using completing the square and discriminant of the quadratic You need to make discriminant dependent on parameter and when you force discriminant of quadratic to be zero you will get cubic equation in terms of introduced parameter Once you have difference of two squares it is easy to factor quartic
Substitution which I used here can be useful in integrals and ordinary differential equations to get rid of trigonometric functions This play with angle bisector construction is useful when we want to present solution in terms of sines and cosines but here is not so great
Could you make a video finding the sin20° using sin3x and the cardano formula? I don't know what i should do when delta is negative in these cases. Thanks
That's really cool, thank you Dr Peyam! I got the same results but instead I used the Weiresstrass trigonometric identities for sine, cosine and tangent, and the solutions also occurs at every (2 pi)n. 😊
That entire complex analysis was unnecessary. The tool you used to numerically solve the quartic could also have solved the initial trig problem. A bit disappointing in the end.
Dr Peyam félicitations pour la vidéo. Comme les coefficients du polynôme sont complexes, quelle est la méthode numérique qu'on peut utiliser pour résoudre cette équation ?
There is the possibility that the roots are much easier than the generic quartic formula. For example, x^4-10x^2+1 has roots +-sqrt(2)+-sqrt(3). That said, this isn’t the case here. If x1 through x8 are the roots of your polynomial and their conjugates, with conj(x1)=x5, conj(x2)=x6, conj(x3)=x7, and conj(x4)=x8, then since two of the roots have absolute value equal to 1, we get x1*x5=x2*x6=x3*x8=x4*x7=1. Thus if the Galois group of Q(x1,…,x8)/Q is G, then there is a map from some subgroup of S4 to G, just saying how the roots x1,…,x4 can permute, because x5 through x8 are determined by them. And then the quotient of this map must be Z/2, because this subgroup is contained in Gal(Q(x1,…,x8)/Q(i)), and so the quotient must be at most Z/2, but of course conjugation gives a nontrivial element of this quotient. So the subgroup is at most of order 48. But if we take the first 10000 primes and factor your polynomial times its complex conjugate, namely x^8-2x^7+12x^6-14x^5+14x^4-14x^3+12x^2-2x+1, mod each of these primes, for only 212 of them does the polynomial have all 8 roots in this field. This is nearly 1/48 of the primes. This gives strong evidence that the Galois group is of order 48, by the Chebotarev density theorem: it says that the fraction of primes whose Frobenius elements are equal to some element (conjugacy class) is equal to the fraction of the group elements that fall into that conjugacy class. The conjugacy class here being the identity element is the only time where all roots are in the quotient field, so 1/48 of all group elements are the identity element, so the group has 48 elements. So the group is a semi-direct product of S4 and Z/2. So there’s nothing easier than just solving the quartic formula.
awesome that I find this video now, I've been struggling with an exam question in which the last step is solving cos(x) - sin(x) = x and i'm hoping this video will bring me some inspiration
Hmmm! I used a right triangle with adjacent side a=1, opposite side = b and hypotenuse =c (1:b:c triangle 📐) then used given that 1/c + b/c +b = 2, then since sin^2 + cos^2 = 1 gives another relationship b^2 = c^2 -1 these two eqn's in b,c eliminate b to get, quartic in real c as... c^4 +2c^3 -4c^2 +2c -2=0 Our friend Wolfram (yegh I cheated too) got c~ 1.1780 , ~ -3.4002 hence invcos(1/1.1780) = x = 31.91 deg = *0.5569* and x= -107.10 deg = *-1.8693* 😁
To use Wolfram you must be on line To use Python with sympy package you need download and install extra software but you can write your own code for quartics solver If you are Linux user write it in C++ If you are Windows user write it in C# In C# you have to write your own Parse method fe as extension method ----------------------------------------------------------------------------------------------------------------------------------------- Suppose we have equation a_{4}x^{4}+a_{3}x^{3} + a_{2}x^{2}+a_{1}x+a_{0} = 0 To get rid of x^3 term you use Horner's rule repeatedly s = (Complex)(-a_{deg-1})/a_{deg} for j = 0:deg-1 for i = deg-1:j a_{i} += a_{i + 1} * s end end Now you can divide coefficients by leading coefficient for i = 0:deg a_{i} = (Complex)(a_{i})/(a_{deg}) end for i = 0:deg-1 x_{i} = s end Now we have equation in the form x^{4} + a_{2}x^{2} + a_{1}x + a_{0} = 0 If you look at Euler's generalization of Cardano's formula you will see x = u + v + w x^2 = (u + v + w)^2 x^2 = u^2 + v^2 + w^2 + 2(uv+uw+vw) x^2 - (u^2 + v^2 + w^2) = 2(uv+uw+vw) (x^2 - (u^2 + v^2 + w^2))^2 = 4(uv+uw+vw)^2 x^4 -2(u^2 + v^2 + w^2)x^2 + (u^2 + v^2 + w^2)^2 = 4(u^2v^2 + u^2w^2 + v^2w^2 + 2(uvuw+uvvw+uwvw)) x^4 -2(u^2 + v^2 + w^2)x^2 + (u^2 + v^2 + w^2)^2 = 4(u^2v^2 + u^2w^2 + v^2w^2)+8(uvuw+uvvw+uwvw) x^4 -2(u^2 + v^2 + w^2)x^2 + (u^2 + v^2 + w^2)^2 = 4(u^2v^2 + u^2w^2 + v^2w^2)+8uvw(u+v+w) x^4 -2(u^2 + v^2 + w^2)x^2 + (u^2 + v^2 + w^2)^2 = 4(u^2v^2 + u^2w^2 + v^2w^2) + 8uvw x x^4 -2(u^2 + v^2 + w^2)x^2 - 8uvw x + (u^2 + v^2 + w^2)^2 - 4(u^2v^2 + u^2w^2 + v^2w^2) = 0 By comparing coefficients we get -2(u^2 + v^2 + w^2) = a_{2} - 8uvw = a_{1} (u^2 + v^2 + w^2)^2 - 4(u^2v^2 + u^2w^2 + v^2w^2) = a_{0} (u^2 + v^2 + w^2) = -a_{2}/2 uvw = -a_{1}/8 ( -a_{2}/2)^2-4(u^2v^2 + u^2w^2 + v^2w^2)=a_{0} (u^2 + v^2 + w^2) = -a_{2}/2 -4(u^2v^2 + u^2w^2 + v^2w^2)=a_{0} - a_{2}^2/4 uvw = -a_{1}/8 u^2 + v^2 + w^2 = -a_{2}/2 u^2v^2 + u^2w^2 + v^2w^2 = 1/16*(a_{2}^2 - 4a_{0}) uvw = -a_{1}/8 u^2 + v^2 + w^2 = -a_{2}/2 u^2v^2 + u^2w^2 + v^2w^2 = 1/16*(a_{2}^2 - 4a_{0}) u^2v^2w^2 = a_{1}^2/64 Now u, v, w are square roots of the solutions of following equation t^3 + a_{2}/2 t^2 + 1/16*(a_{2}^2 - 4a_{0})t - a_{1}^2/64 = 0 with extra condition uvw = -a_{1}/8 which helps you to choose correct square roots of the solution to this resolvent cubic Solutions to the quartics are x_{0} += u+v+w x_{1} += u-v-w x_{2} += -u+v-w x_{3} += -u-v+w You solve cubic in the same way a_{3}x^{3}+a_{2}x^{2}+a_{1}x+a_{0} = 0 To get rid of x^2 term you use Horner's rule repeatedly s = (Complex)(-a_{deg-1})/(deg*a_{deg}) for j = 0:deg-1 for i = deg-1:j a_{i} += a_{i + 1} * s end end Now you can divide coefficients by leading coefficient for i = 0:deg a_{i} = (Complex)(a_{i})/a_{deg} end for i = 0:deg-1 x_{i} = s end Now we have x^{3} + a_{1}x+a_{0} = 0 Let x = u + v x^3 = (u+v)^3 x^3 = u^3+3u^2v+3uv^2+v^3 x^3 = 3u^2v+3uv^2 + u^3 + v^3 x^3 = 3uv(u+v) + (u^3 + v^3) x^3 = 3uv x + (u^3 + v^3) x^3 - 3uv x - (u^3 + v^3)= 0 By comparing coefficients we get -3uv = a_{1} -(u^3 + v^3)=a_{0} uv = -a_{1}/3 u^3 + v^3 = -a_{0} u^3v^3 = -a_{1}^3/27 u^3 + v^3 = -a_{0} u and v are cube roots of the solutions to the following equation t^2+a_{0}t -a_{1}^3/27=0 with extra condition uv = -a_{1}/3 which helps you to choose correct cube roots of the solution to this resolvent quadratic Let ε be the principal cube root of unity x_{0} += u + v x_{1} += εu + ε^2v x_{2} += ε^2u + εv
Euler's generalization of Cardano's formula is good if you want to write program For paper and pencil calculations I prefer Ferrari's method Assume that we have quartic equation in the form a_{4}x^{4}+a_{3}x^{3}+a_{2}x^2+a_{1}x+a_{0} = 0 Divide both sides of the equation by a_{4} x^{4}+a_{3}/a_{4}x^{3}+a_{2}/a_{4}x^2+a_{1}/a_{4}x+a_{0}/a_{4} = 0 (x^{4}+a_{3}/a_{4}x^{3}) - (-a_{2}/a_{4}x^2-a_{1}/a_{4}x-a_{0}/a_{4}) = 0 We want to have difference of two squares so we complete the square in the left bracket (x^{4}+a_{3}/a_{4}x^{3}+a_{3}^2/(4a_{4}^2)x^2)) - ((a_{3}^2/(4a_{4}^2)-a_{2}/a_{4})x^2-a_{1}/a_{4}x-a_{0}/a_{4}) = 0 (x^{2} + a_{3}/(2a_{4})x)^{2} - ((a_{3}^2-4a_{4}a_{2})/(4a_{4}^2)x^2 -a_{1}/a_{4}x -a_{0}/a_{4}) = 0 Now we observe that expression in the right bracket is quadratic polynomial so it will be perfect square when it's discriminant is equal to zero If we try to calculate discriminant now it may not be equal to zero so we have to make it dependent from parameter To introduce parameter we use concept of completing the square once again (x^{2} + a_{3}/(2a_{4})x + y/2)^{2} - ((y + (a_{3}^2-4a_{4}a_{2})/(4a_{4}^2))x^2+(a_{3}/(2a_{4})y - a_{1}/a_{4})x+y^2/4 -a_{0}/a_{4}) = 0 Discriminant must be zero 4(y^2/4 -a_{0}/a_{4})(y + (a_{3}^2-4a_{4}a_{2})/(4a_{4}^2)) - (a_{3}/(2a_{4})y - a_{1}/a_{4})^2 = 0 (y^2 - 4a_{0}/a_{4})(y + (a_{3}^2-4a_{4}a_{2})/(4a_{4}^2)) - (a_{3}/(2a_{4})y - a_{1}/a_{4})^2 = 0 y^3 + a_{3}^2/(4a_{4}^2)y^2 - a_{2}/a_{4}y^2 - 4a_{0}/a_{4}y - a_{3}^2a_{0}/a_{4}^{3} + 4a_{2}a_{0}/a_{4}^2 - (a_{3}^2/(4a_{4}^2)y^2 - a_{3}a_{1}/a_{4}^2 + a_{1}^2/a_{4}^2) = 0 y^3 - a_{2}/a_{4}y^2 + (a_{3}a_{1} - 4a_{4}a_{0})/a_{4}^2y+(4a_{4}a_{2}a_{0} - a_{3}^2a_{0}-a_{4}a_{1}^2)/a_{4}^{3}=0 This is cubic resolvent I showed the method of solving it in previous comment
I’ve been trying to solve quartics for months and this video proves it was a tangential pursuit. I took one look at that quartic formula and damn near shit myself lol.
@@drpeyam so, when approximating roots for “impossible” polynomials/functions, is there a complex analogue to newtons method or do you have to use the residue theorem and branch cuts when dealing with limits with a continuum of directions?
Using the tangent half angle substitution would be another choice, and you will arrive at a depressed quartic with integer coefficients instead. Just found out the root would be “nicer” if the RHS is 3 instead of 2
Keep it simple ! Use trig formula relative to t= tan(x/2) : sin(x) = 2t/(1+t^2) , cos(x) = (1-t^2)/(1+t^2), tan(x) = 2t/(1-t^2) Reduce to the same denominator (1-t^2)*(1+t^2) etc....
@@drpeyam Are you kidding me? It's so well known that it actually has a name: the Weierstrass substitution and it's used all the time in evaluating integrals of trigonometric functions.
sinx + cosx + tanx = -1 or 1 will give you much much nicer solutions, which will yield exact values which won't require resorting to numerical techniques
Given that the first few steps seemed to make things more complicated what would prompt someone to make these steps. I always feel the why (as opposed to the how) of such steps are left undiscussed in maths videos.
That’s a valid point, but this is very standard when you deal with unsolvable real equations, especially those that involve trig. Check out my cos = 2 and related videos for easier examples
@@drpeyam I'm sorry i kept waiting for you to notice and you didn't so left after Anyway thank you very much for your effort i really appreciate the content you provide you and other youtubers about maths
Creo que existen 3 matemáticos que ahora (para mí) Son los Dioses del aprendizaje en TH-cam : El blackpenred , Derivando y Usted Dr. Peyam . Muchas gracias por su sabiduría y el amor que le entrega a las matemáticas a la Hora de enseñar en TH-cam ! Saludos
I like that you mentioned that there is an exact solution to the problem and only approximated for aesthetic reasons. Otherwise there would be no reason to use Newtons method right away. (This is the way I would "solve" the equation since I am just a physicist :-))
terrible method...just let u=\tan(x/2) and you get a nicer polynomial equation 3u^4-2u^2+4u-1=0 which only has two real solutions but still not easy to solve. But it is much shorter route than shown in the video
@@drpeyam It is enlightening indeed. It shows how to make things complex, forgive the pun. Substitution z=cos(x) quickly leads to the quartic equation 2z^4-2z^3+4z^2-2z-1=0. The resulting polynomial is concave up over the reals, and changes sign on the intervals [-1/4,-1/3] and [2/3,1] thus having exactly two real roots.
in the upcoming second part of this outrageousness we'll see that those impostors along with two others from cosh+sinh+tanh point to where Mjollnir is buried. I bet.
Hmm..Let me see... The circumfence of an ellipse (c) has the relation to half the short axis (a) and half the long axis (b) as follows: 1) b^2 = a^2 + c^2 Now I think You are wrong in accusing Pythagoras of something he is innocent of. I think You should solve the equation for c^2: 2) c^2 = b^2 - a^2 = (b-a) * (b+a) Now somebody (a schoolteacher on TH-cam) told me that the area of and ellipse is 3) area = pi * a * b That is all fine and dandy; but there is NO FORMULA for the circumfence of an ellipse expressed by the short and the long axis. Now I don't quite follow your argument, my dim wit won't allow it. But where I wonder is: What the devil happened to pi??? Where did You pull the plug on pi, so it disappeared into the sewer. Intuitively the formula seems to be splendid, but You jump a few steps to many for me to understand. If indeed You are right it solves one of the more fundamental physics problems. (personally I came across it when I wanted to calculate the surface of a submarine. That is the surface of the ellipsoid - roughly. Johannes Kepler had a devil of a problem, when he proposed his three laws. Planetary orbits are ellipses with the sun in one focus. (here I allways wondered - what happened to the other focus). The problem here is calculus: As a planet moves away from the sun the speed decreases (and the kinetic energy = ½ * m * v^2) and simultaneously the potential energy (which - as I recall - is distance * mass) increases, and the conservation of energy requires that the sum of the two is constant. The next problem is that electrons around a nucleous has the same problem - though here it is the electromagnetic forces that replaces gravity. The solution here is to run with approximations.
@@drpeyam I have not seen the WHOLE video. Also, some others pointed out a POTENTIAL error at 4:36, did you look into that? I may dig into it later today...
@@drpeyam no you have not understood actually I am also a student from maths bagground. My question is very simple what is the motivation behind the problem I find only calculation which I guess to a student who have basic knowledge in Complex Analysis
Bro wtf you can call yourself a doctor u don't even know that only sin is nothing in maths sin(x) is smthng yet you are using sin in your thumbnail sin means mortal act like you are doing
The coefficient of z^3 is 2-4i and not 2+4i in the expansion. You correct it later.
Nice problem.
he actually, corrects it in the very next line while dividing by (1 + i)
(1 + i)(-1 -3i) = - 1 - 3i - i + 3 = 2 -4i
So, he did write it the wrong way and as he followed his own script he gets to the right path to the solution
👍🏻
You've got a good eye tho
I was actually waiting for this issue to bite him so he had to correct himself later, but instead he just copied from his notes for the next line. 'Who wants to watch me divide a whole bunch of terms by 1+i?' Oh I would have liked to see you find the error later and self correct.
technically, it's a refresh, not a correction.
I was about to say :)
OK good, I was watching that and I noticed it too, but I figured I was missing something since there was a lot of i floating around and I assumed maybe there was some cancellation going on. But nope, The sign just got flipped the wrong way. :^)
6:30 and the rest is left as an exercise for the reader.
7:00 "and we just plug this into the analytic solution for a 4th order polynomial"
rofl yeah right. that equation occupies 3 pages in Abramowitz & Stegun
7:10 which he admits, with a big grin
7:55 any math prof who is able to incorporate an "among us" reference into his lectures is in my good books.
very nicely done
The problems you present on this channel are wild, and are so interesting. Thank you for your videos, and for taking us along on this journey.
Thanks so much!!!
I used a more classical approach using basic trigo formulas
Define
cos = x
From cos²+sin² = 1
sin = sqrt(1-x²)
From tan=sin/cos
tan = sqrt(1-x²)/x
Then cos+sin+tan = 2 can be rewritten as
x+sqrt(1-x²)+sqrt(1-x²)/x = 2
Multiply by x
x²+x*sqrt(1-x²)+sqrt(1-x²) = 2x
Isolate the sqrt
-x²+2x = (x+1)*sqrt(1-x²)
Square both sides
(-x²+2x)² = (x+1)²*(1-x²)
Develop and simplify to get the following quartic equation
2x⁴ - 2x³ + 4x² - 2x - 1 = 0
An online quartic equation calculator then gave me 2 real solutions:
-0.294096415633 and 0.848926885181
Since x=cos , the final solutions are
arccos(-0.294096415633) = ±1.8693
arccos(0.848926885181) = ±0.5568
And of course, each solution has to be tested to figure out the proper sign.
Yes, it's bizarre that he doesn't work with cos and stick to polynomials over the reals. There's no good reason to decide to work with e^{ix} and do everything over the complex numbers. Also, it seems like a really uninteresting problem! Why the 2 in the initial equation? Maybe it came out of a real life computation that turned up in something. I did it your way and was expecting the quartic for cos(theta) to be factorisable into the product of two quadratic polys or something, to give a nice solution for cos, but no - it's irreducible over the rationals. Furthermore, the quartic poly for cos actually has full Galois group S_4 over the rational numbers meaning that the theta isn't a rational multiple of pi (in radians) or a rational number
(in degrees). You can't even say at the end, something like "and so the argument of the sin,cos and tan functions that gives a solution of this equation is 35 degrees" - it's some transcendental number which isn't a rational multiple of pi if you are working in radians and I think probably a transcendental number if you are working in degrees. Pretty pointless really. Here's some random problem that leads to a GENERAL quartic polynomial over Q which I can't write down a nice solution to but for which you can use generic methods to get approximations to, just like you could with any other quartic polynomial.
half angle tan t-substitution is even simpler
No need to invoke the complex representations of the functions... as already others have pointed out.
My method: First notice that cos(x) = 0 obviously gives no solution, hence it's no problem to multiply the equation with that, resulting in cos²(x) + sin(x) cos(x) + sin(x) = 2 cos(x).
Isolating the terms with sin on the left hand side gives sin(x) (cos(x) + 1) = cos(x) (2 - cos(x))
Squaring both sides and then using sin²(x) = 1 - cos²(x) gives (1 - cos²(x)) (cos(x) + 1)² = cos²(x) (2 - cos(x)), and this then results in a quartic equation for cos(x).
Using Wolfram Alpha or something similar), cos(x) \approx -0.29410 and cos(x) \approx 0.84893. Both give two solutions, and plugging these four solutions into the original equation shows that only the two -1.8693 and 0.5568 are really valid solutions.
I went as far as rewriting in terms of sin and eliminating the square roots but I couldn't see any 'trick' to factor the quartic. Then I watched the video. Only thing interesting here is writing it in exponentional form to side step (hide?) the radicals. As far as solving it numerically just use the original equation.
Easy to see that if the angle is 0 the sum is 1. If 90 deg the sum is infinity.
Try 45 deg sum 2.4142 too high
try 30 deg sum 1.9433 too low
try 37 deg sum 2.1540
try 33 deg sum 2.0327
try 32 deg sum 2.0028367
try 31.5 deg sum 1.9879395
try 31.8 deg sum 1.99032138
try 31.9 deg sum 1.999855202
try 31.95 deg sum 2.00134582
try 31.92 deg sum 2.00045142
try 31.91 deg sum 2.00015330
try 31.905 deg sum 2.00000425
12 quick calculations using windows calculator.
That's how I did it too. It's not very difficult. If c is cos(x) you find that c is one of two roots of c^4-3c^3+5c^2-c-1. There are 2 false solutions because of squaring that is done along the way.
@@jimskea224 the polynomial should be 2c⁴ - 2c³ + 4c² - 2c - 1. graphing this function with sin(x) + cos(x) + tan(x) - 2 shows that, in [0, 2π), their zeros match up with the polynomial having 1 extraneous solution.
Is there a way to use the requirement that the roots lie on the unit circle in the complex plane to reduce the order of the polynomial to a quadratic?
I don’t see how, the roots of z^n - 1 all lie on the unit circle but you cannot reduce it to a quadratic
My first thought is you do polynomial division on the quartic, where you divide by the factor (z-a)(z-b), with a and b the unknown unit circle roots. Then solve the resulting quadratic to get the roots we don't want, and then do polynomial division again to get the quadratic for the roots we do want. This sounds like hell though!
4:35 Shouldn't it be (2 - 4i)z^3?
Yeah
@@drpeyam replied to my comment! I'm going to be famous! Famous, I say!
😂😂😂😂
Very nice!! And you should never forget the +2 piM ,it is like +C in integrals 😃💯
6:31 there is symmetry in the coefficients when interchanging real and imaginary parts. Would that be a hint towards an analytical solution of the polynomial?
I thought this symmetry was just due to the fact that the conjugate of z was 1/z, but indeed we can exploit it much further.
Dividing by z^2 we get P(z) + i bar(P(z)) = 0 as interchanging real and imaginary parts is equivalent to taking the conjugate (that's what bar means, note that bar(z) = 1/z here) and multiplying by i, where P(z) = z^2 + (-1-3i) z + 1.
However if Z is a complex number, one has Z + i bar(Z) = 0 if and only if Re(Z) + Im(Z) = 0 which is equivalent to Z = a (1-i) where a is real.
Thus P(z) divided by 1-i is real meaning that P(z) (1+i) is real.
Let's write z = a + ib. We then get (a^2 - b^2 + 2aib - a + 3b - i(3a+b) + 1)(1+i) is real i.e. a^2 - b^2 + 2ab - 4a + 2b + 1 = 0.
We thus get a quadratic equation depending on a so we get a = 2 - b pm sqrt(2b^2 - 6b + 3), where pm is plus or minus.
By replacing z by z = 2 - b pm sqrt(2b^2 - 6b + 3) + ib in the original equation we may continue with just b to be determined....
But at least, you can check all the solutions he magically gave at the end have that form for z 😉
I think this is the first and only TH-camr I have ever seen who says “thanks for watching” at the beginning, not the end, of every video. It’s interesting, and also really nice! Epic content as usual Dr πm.
7:50 If I want to eliminate a root in an exam can I say this for extra credit?
at 4:36 shouldn't it be -4i?
Yeah
9:25 Another way to discard two of the possible solutions is Euler's formula. For z= exp(ix)= 0.04 + 0.32i, cosx = 0.04, sinx = 0.32, so tanx= 8. So their sum is greater than 2. The case z= exp(ix)= 0.4 + 3.11i, is impossible since sinx cannot be greater than 1, for real x.
I like that!
I love your channel and I dont like to point out trivial mistakes but there seems to be a problem with the coefficient for z^3.
Yeah
If you're going to use numeric methods, you might as well just look for the two principal solutions to sin(x)+cos(x)+tan(x)=2 directly. A couple of minutes with ten rows of a spreadsheet starting at 0.5 with increments of 0.01 and successively refining them gives 0.556844808 and then starting at -2 with increments of -0.01 gives -1.869306314.
it's ridiculously crude and algorithmically inefficient, but much faster than than deriving and solving a fourth order polynomial with complex coefficients. Of course, the Weierstrass substitution also gives a fourth order polynomial in t with rational coefficients that you can solve for t=tan(x/2), but that still needs numeric solutions in the practical case.
...Good day Dr. Peyam, This was a wonderful and enjoyable demonstration of all-round math skills, and instead of Tau I would, if I was in charge, give you the Nobel Prize for making mathematics accessible to a wide audience, even for me with my limited knowledge. Je vous remercie beaucoup, Jan-W p.s. Ma première action en essayant de résoudre le problème á également été de créer un graphique comme vous pour un peut plus de clarté sur le problème en question!
Any complex number of the form r*e^(i*phi) for any r and any angle phi is on the unit circle?
No just if r = 1
@@drpeyam Merci 🙏
If you were going to resort to a numerical solver anyway, you might as well just apply Newton's formula to the function f(x)=cos(x)+sin(x)+tan(x)-2. Starting with x=0, in just 3 iterations you already get x=0.5568448. Starting with x=-2 gives the negative solution. It's not clear to me why going to a quartic equation first is any more "enlightening".
I’d def more enlightening, because you can insert the huge quadric root solution to get an explicit formula, unlike Newton’s method
And if you do want to solve it purely algebraically, it seems far simpler to avoid complex numbers: if you let c=cos(x), then as another commenter pointed out you quickly get the nicer equation 2c^4 - 2c^3 + 4c^2 - 2c - 1 = 0. Grinding through the quartic formula gives solutions as follows: define t = (1/12)*(334+54*sqrt(41))^(1/3) + (1/12)*(334-54*sqrt(41))^(1/3) - 13/24 and then the real solutions are given by c = sqrt(t/2) +/- sqrt(-t/2 - 13/16 + 1/(16*sqrt(2t))) + 1/4.
Nice but I don’t think it’s simpler
@@Notthatkindofdr I find the quartic is c^4-3c^3+5c^2-c-1=0. And yes, it's simpler.
@@jimskea224 Let s=sin(x) and c=cos(x), so the equation is c+s+s/c = 2. Rearranging gives s(c+1) = c(2-c). Square both sides and get
(1-c^2)(c+1)^2 = c^2(2-c)^2
(1-c^2)(c^2+2c+1) = c^2(4-4c+c^2)
-c^4-2c^3+2c+1 = c^4-4c^3+4c^2
and then this gives the equation 2c^4-2c^3+4c^2-2c-1 = 0.
Real number approach
We know that slope of the line is tan(a)
so slope of angle bisector is tan(a/2)
Let's follow the steps of construction
sin(a)x - cos(a)y = 0
y = 0
Let vertex B of divided angle has coordinates (0,0)
Now we choose point on the one of the rays arbitrarily
Let it be D = (1,sin(a)/cos(a))
We need isosceles triangle so we need circle in this approach
|BD|^2 = (1 - 0)^2 + (sin(a)/cos(a))^2
|BD|^2 = 1 + sin^2(a)/cos^2(a)
|BD|^2 = cos^2(a)/cos^2(a) + sin^2(a)/cos^2(a)
|BD|^2 = (cos^2(a) + sin^2(a))/cos^2(a)
|BD|^2 = 1/cos^2(a)
|BD| = 1/cos(a)
x^2 +y^2 = 1/cos^2(a)
We write system of equations
x^2 +y^2 = 1/cos^2(a)
y=0
x^2 = 1/cos^2(a)
y = 0
(x^2 - 1/cos^2(a))=0
y = 0
(x - 1/cos(a))(x + 1/cos(a))=0
y = 0
Now we choose point E = (1/cos(a) , 0)
We have vertices of isosceles triangle, line perpendicular to DE passing through point B divides this triangle int two congruent right triangles
Equation for line perpendicular to AB passing through point C is y - yC = -(xB - xA)/(yB - yA)(x - xC)
y - 0 = -(1/cos(a) - 1)/(0 - sin(a)/cos(a))(x-0)
y = -(1/cos(a) - 1)/(0 - sin(a)/cos(a))x
y = -(1/cos(a) - 1)/(- sin(a)/cos(a))x
y = (1/cos(a) - 1)/( sin(a)/cos(a))x
y = (1/cos(a) - cos(a)/cos(a))/( sin(a)/cos(a))x
y = ((1-cos(a))/cos(a))/( sin(a)/cos(a))x
y = (1-cos(a))/sin(a) x
tan(a/2) = (1-cos(a))/sin(a)
(1-cos(x))/sin(x) = y
ysin(x) = 1-cos(x)
y^2sin^2(x) = (1-cos(x))^2
y^2(1-cos(x))(1+cos(x)) = (1-cos(x))^2
y^2(1+cos(x)) = (1-cos(x))
y^2 = (1-cos(x))/(1+cos(x))
y^2 = (2-(1+cos(x)))/(1+cos(x))
y^2 = 2/(1+cos(x)) - 1
y^2+1 = 2/(1+cos(x))
(1+cos(x))/2 = 1/(y^2+1)
1+cos(x) = 2/(y^2+1)
cos(x) = 2/(y^2+1) - 1
cos(x) = (2-1-y^2)/(1+y^2)
cos(x) = (1 - y^2)/(1+y^2)
1-cos(x) = 1 - (1 - y^2)/(1+y^2)
1-cos(x) = ((1+y^2 ) - (1 - y^2))/(1+y^2)
1-cos(x) = 2y^2/(1+y^2)
sin(x) = 1/y * 2y^2/(1+y^2)
sin(x) = 2y/(1+y^2)
tan(x) = (2y/(1+y^2))/((1-y^2)/(1+y^2))
tan(x) = 2y/(1 - y^2)
So we have equation
2y/(1+y^2) + (1 - y^2)/(1+y^2) + 2y/(1 - y^2) = 2
2y(1-y^2) + (1-y^2)^2+2y(1+y^2) = 2(1-y^2)(1+y^2)
2y(1-y^2 + 1+y^2) + (1-y^2)^2 = 2(1-y^2)(1+y^2)
4y +(1-y^2)^2 = 2(1-y^4)
4y + (1-y^2)^2 + 2(y^4 - 1) = 0
(y^4-2y^2+1)+2y^4 - 2 + 4y = 0
3y^4 - 2y^2 + 4y - 1 = 0
Thanks for the details
Real solutions are
2arctan(y_{1})+2kπ , 2arctan(y_{2})+2kπ
Two other series of solutions might be complex
I solved my quartics with real coefficients from scratch
but expressed solution in terms of p where p is the root of follownig polynomial
p^3+2p^2+12p-24
I used Ferrari method because for me it is the most comfortable in computations
(It also requires the least computations among all the methods I know)
In Ferrari method you express quartic as a difference of two squares using completing the square and discriminant of the quadratic
You need to make discriminant dependent on parameter and when you force discriminant of quadratic to be zero
you will get cubic equation in terms of introduced parameter
Once you have difference of two squares it is easy to factor quartic
Substitution which I used here can be useful in integrals and ordinary differential equations to get rid of trigonometric functions This play with angle bisector construction is useful when we want to present solution in terms of sines and cosines but here is not so great
Could you make a video finding the sin20° using sin3x and the cardano formula? I don't know what i should do when delta is negative in these cases. Thanks
At 4:37 isnt it supposed to be (2-4i)Z³?
Doesn’t matter
That's really cool, thank you Dr Peyam! I got the same results but instead I used the Weiresstrass trigonometric identities for sine, cosine and tangent, and the solutions also occurs at every (2 pi)n. 😊
(sinx+cosx)^2=(2-tgx)^2
2tgx/(1+(tgx)^2)=3+(tgx)^2-4tgx
tgx=u
2u=(1+u^2)(u-3)(u-1)
Oh wow, very elegant
That entire complex analysis was unnecessary. The tool you used to numerically solve the quartic could also have solved the initial trig problem. A bit disappointing in the end.
No no, the quadric is necessary, because if you have the time and patience you can get an explicit formula.
@@drpeyam which you didn’t do. The entire video I was expecting to see an analytic answer and then nothing came.
Then the video would be 1h long
@@drpeyam and we would love every minute of it. Who else solves quarries? Go for it.
I like how his cheeks are pink so it looks like he's recording this for his crush and is really shy
Hahaha awww ☺️
Dr Peyam félicitations pour la vidéo. Comme les coefficients du polynôme sont complexes, quelle est la méthode numérique qu'on peut utiliser pour résoudre cette équation ?
De plus lorsque vous écrivez +2Mπ. A mon sens on doit plutôt écrire +Mπ
On sait résoudre pour des polynômes de degré 4 mais la formule est pas gentille, donc Wolfram.
There is the possibility that the roots are much easier than the generic quartic formula. For example, x^4-10x^2+1 has roots +-sqrt(2)+-sqrt(3).
That said, this isn’t the case here. If x1 through x8 are the roots of your polynomial and their conjugates, with conj(x1)=x5, conj(x2)=x6, conj(x3)=x7, and conj(x4)=x8, then since two of the roots have absolute value equal to 1, we get x1*x5=x2*x6=x3*x8=x4*x7=1. Thus if the Galois group of Q(x1,…,x8)/Q is G, then there is a map from some subgroup of S4 to G, just saying how the roots x1,…,x4 can permute, because x5 through x8 are determined by them. And then the quotient of this map must be Z/2, because this subgroup is contained in Gal(Q(x1,…,x8)/Q(i)), and so the quotient must be at most Z/2, but of course conjugation gives a nontrivial element of this quotient.
So the subgroup is at most of order 48. But if we take the first 10000 primes and factor your polynomial times its complex conjugate, namely x^8-2x^7+12x^6-14x^5+14x^4-14x^3+12x^2-2x+1, mod each of these primes, for only 212 of them does the polynomial have all 8 roots in this field. This is nearly 1/48 of the primes. This gives strong evidence that the Galois group is of order 48, by the Chebotarev density theorem: it says that the fraction of primes whose Frobenius elements are equal to some element (conjugacy class) is equal to the fraction of the group elements that fall into that conjugacy class. The conjugacy class here being the identity element is the only time where all roots are in the quotient field, so 1/48 of all group elements are the identity element, so the group has 48 elements.
So the group is a semi-direct product of S4 and Z/2. So there’s nothing easier than just solving the quartic formula.
So fancy!
@@drpeyam sorry, that’s what a number theorist like me thinks about after videos like these 😅
You could have also used the parametric formulas for sine cosine and tangent
Thanks for ideas
These type of problems come in jee adv also
great style of vid, and very cool stuff
Why did we get those two "solutions" for z that weren't valid?
It’s because not every number z is of the form exp(i x) where x is real. The complex equation is more general
That shirt is absolute gold
awesome that I find this video now, I've been struggling with an exam question in which the last step is solving cos(x) - sin(x) = x and i'm hoping this video will bring me some inspiration
Another approach is to express all terms e.g. in terms of tan which leads to a third order equation , with a real solution and two complex ones.
Hmmm! I used a right triangle with adjacent side a=1, opposite side = b and hypotenuse =c
(1:b:c triangle 📐) then used given that
1/c + b/c +b = 2,
then since sin^2 + cos^2 = 1
gives another relationship b^2 = c^2 -1
these two eqn's in b,c eliminate b to get, quartic in real c as...
c^4 +2c^3 -4c^2 +2c -2=0
Our friend Wolfram (yegh I cheated too) got c~ 1.1780 , ~ -3.4002
hence invcos(1/1.1780) = x = 31.91 deg = *0.5569*
and x= -107.10 deg = *-1.8693* 😁
Very nice!
To use Wolfram you must be on line
To use Python with sympy package you need download and install extra software but
you can write your own code for quartics solver
If you are Linux user write it in C++
If you are Windows user write it in C#
In C# you have to write your own Parse method fe as extension method
-----------------------------------------------------------------------------------------------------------------------------------------
Suppose we have equation
a_{4}x^{4}+a_{3}x^{3} + a_{2}x^{2}+a_{1}x+a_{0} = 0
To get rid of x^3 term you use Horner's rule repeatedly
s = (Complex)(-a_{deg-1})/a_{deg}
for j = 0:deg-1
for i = deg-1:j
a_{i} += a_{i + 1} * s
end
end
Now you can divide coefficients by leading coefficient
for i = 0:deg
a_{i} = (Complex)(a_{i})/(a_{deg})
end
for i = 0:deg-1
x_{i} = s
end
Now we have equation in the form
x^{4} + a_{2}x^{2} + a_{1}x + a_{0} = 0
If you look at Euler's generalization of Cardano's formula you will see
x = u + v + w
x^2 = (u + v + w)^2
x^2 = u^2 + v^2 + w^2 + 2(uv+uw+vw)
x^2 - (u^2 + v^2 + w^2) = 2(uv+uw+vw)
(x^2 - (u^2 + v^2 + w^2))^2 = 4(uv+uw+vw)^2
x^4 -2(u^2 + v^2 + w^2)x^2 + (u^2 + v^2 + w^2)^2 = 4(u^2v^2 + u^2w^2 + v^2w^2 + 2(uvuw+uvvw+uwvw))
x^4 -2(u^2 + v^2 + w^2)x^2 + (u^2 + v^2 + w^2)^2 = 4(u^2v^2 + u^2w^2 + v^2w^2)+8(uvuw+uvvw+uwvw)
x^4 -2(u^2 + v^2 + w^2)x^2 + (u^2 + v^2 + w^2)^2 = 4(u^2v^2 + u^2w^2 + v^2w^2)+8uvw(u+v+w)
x^4 -2(u^2 + v^2 + w^2)x^2 + (u^2 + v^2 + w^2)^2 = 4(u^2v^2 + u^2w^2 + v^2w^2) + 8uvw x
x^4 -2(u^2 + v^2 + w^2)x^2 - 8uvw x + (u^2 + v^2 + w^2)^2 - 4(u^2v^2 + u^2w^2 + v^2w^2) = 0
By comparing coefficients we get
-2(u^2 + v^2 + w^2) = a_{2}
- 8uvw = a_{1}
(u^2 + v^2 + w^2)^2 - 4(u^2v^2 + u^2w^2 + v^2w^2) = a_{0}
(u^2 + v^2 + w^2) = -a_{2}/2
uvw = -a_{1}/8
( -a_{2}/2)^2-4(u^2v^2 + u^2w^2 + v^2w^2)=a_{0}
(u^2 + v^2 + w^2) = -a_{2}/2
-4(u^2v^2 + u^2w^2 + v^2w^2)=a_{0} - a_{2}^2/4
uvw = -a_{1}/8
u^2 + v^2 + w^2 = -a_{2}/2
u^2v^2 + u^2w^2 + v^2w^2 = 1/16*(a_{2}^2 - 4a_{0})
uvw = -a_{1}/8
u^2 + v^2 + w^2 = -a_{2}/2
u^2v^2 + u^2w^2 + v^2w^2 = 1/16*(a_{2}^2 - 4a_{0})
u^2v^2w^2 = a_{1}^2/64
Now u, v, w are square roots of the solutions of following equation
t^3 + a_{2}/2 t^2 + 1/16*(a_{2}^2 - 4a_{0})t - a_{1}^2/64 = 0
with extra condition uvw = -a_{1}/8
which helps you to choose correct square roots of the solution to this resolvent cubic
Solutions to the quartics are
x_{0} += u+v+w
x_{1} += u-v-w
x_{2} += -u+v-w
x_{3} += -u-v+w
You solve cubic in the same way
a_{3}x^{3}+a_{2}x^{2}+a_{1}x+a_{0} = 0
To get rid of x^2 term you use Horner's rule repeatedly
s = (Complex)(-a_{deg-1})/(deg*a_{deg})
for j = 0:deg-1
for i = deg-1:j
a_{i} += a_{i + 1} * s
end
end
Now you can divide coefficients by leading coefficient
for i = 0:deg
a_{i} = (Complex)(a_{i})/a_{deg}
end
for i = 0:deg-1
x_{i} = s
end
Now we have
x^{3} + a_{1}x+a_{0} = 0
Let x = u + v
x^3 = (u+v)^3
x^3 = u^3+3u^2v+3uv^2+v^3
x^3 = 3u^2v+3uv^2 + u^3 + v^3
x^3 = 3uv(u+v) + (u^3 + v^3)
x^3 = 3uv x + (u^3 + v^3)
x^3 - 3uv x - (u^3 + v^3)= 0
By comparing coefficients we get
-3uv = a_{1}
-(u^3 + v^3)=a_{0}
uv = -a_{1}/3
u^3 + v^3 = -a_{0}
u^3v^3 = -a_{1}^3/27
u^3 + v^3 = -a_{0}
u and v are cube roots of the solutions to the following equation
t^2+a_{0}t -a_{1}^3/27=0
with extra condition uv = -a_{1}/3
which helps you to choose correct cube roots of the solution to this resolvent quadratic
Let ε be the principal cube root of unity
x_{0} += u + v
x_{1} += εu + ε^2v
x_{2} += ε^2u + εv
Euler's generalization of Cardano's formula is good if you want to write program
For paper and pencil calculations I prefer Ferrari's method
Assume that we have quartic equation in the form
a_{4}x^{4}+a_{3}x^{3}+a_{2}x^2+a_{1}x+a_{0} = 0
Divide both sides of the equation by a_{4}
x^{4}+a_{3}/a_{4}x^{3}+a_{2}/a_{4}x^2+a_{1}/a_{4}x+a_{0}/a_{4} = 0
(x^{4}+a_{3}/a_{4}x^{3}) - (-a_{2}/a_{4}x^2-a_{1}/a_{4}x-a_{0}/a_{4}) = 0
We want to have difference of two squares so we complete the square in the left bracket
(x^{4}+a_{3}/a_{4}x^{3}+a_{3}^2/(4a_{4}^2)x^2)) - ((a_{3}^2/(4a_{4}^2)-a_{2}/a_{4})x^2-a_{1}/a_{4}x-a_{0}/a_{4}) = 0
(x^{2} + a_{3}/(2a_{4})x)^{2} - ((a_{3}^2-4a_{4}a_{2})/(4a_{4}^2)x^2 -a_{1}/a_{4}x -a_{0}/a_{4}) = 0
Now we observe that expression in the right bracket is quadratic polynomial
so it will be perfect square when it's discriminant is equal to zero
If we try to calculate discriminant now it may not be equal to zero so we have to make it dependent from parameter
To introduce parameter we use concept of completing the square once again
(x^{2} + a_{3}/(2a_{4})x + y/2)^{2} - ((y + (a_{3}^2-4a_{4}a_{2})/(4a_{4}^2))x^2+(a_{3}/(2a_{4})y - a_{1}/a_{4})x+y^2/4 -a_{0}/a_{4}) = 0
Discriminant must be zero
4(y^2/4 -a_{0}/a_{4})(y + (a_{3}^2-4a_{4}a_{2})/(4a_{4}^2)) - (a_{3}/(2a_{4})y - a_{1}/a_{4})^2 = 0
(y^2 - 4a_{0}/a_{4})(y + (a_{3}^2-4a_{4}a_{2})/(4a_{4}^2)) - (a_{3}/(2a_{4})y - a_{1}/a_{4})^2 = 0
y^3 + a_{3}^2/(4a_{4}^2)y^2 - a_{2}/a_{4}y^2 - 4a_{0}/a_{4}y - a_{3}^2a_{0}/a_{4}^{3} + 4a_{2}a_{0}/a_{4}^2 - (a_{3}^2/(4a_{4}^2)y^2 - a_{3}a_{1}/a_{4}^2 + a_{1}^2/a_{4}^2) = 0
y^3 - a_{2}/a_{4}y^2 + (a_{3}a_{1} - 4a_{4}a_{0})/a_{4}^2y+(4a_{4}a_{2}a_{0} - a_{3}^2a_{0}-a_{4}a_{1}^2)/a_{4}^{3}=0
This is cubic resolvent
I showed the method of solving it in previous comment
very impressive that this video is a setup for a pun at the end
That was a joy to watch, as always :D
When the roots are sus 😳
I’ve been trying to solve quartics for months and this video proves it was a tangential pursuit. I took one look at that quartic formula and damn near shit myself lol.
Right???? 😂😂
@@drpeyam so, when approximating roots for “impossible” polynomials/functions, is there a complex analogue to newtons method or do you have to use the residue theorem and branch cuts when dealing with limits with a continuum of directions?
@@dominicellis1867 i believe newtons method also works for complex functions
your smiles are so good that they automatically make me smile too ! 😊
😁
Using the tangent half angle substitution would be another choice, and you will arrive at a depressed quartic with integer coefficients instead. Just found out the root would be “nicer” if the RHS is 3 instead of 2
Yes very depressing
Nice job, doc. I know your Berkeley buddy bprp would get this one - the dude is in love with "i".
Keep it simple !
Use trig formula relative to t= tan(x/2) : sin(x) = 2t/(1+t^2) , cos(x) = (1-t^2)/(1+t^2), tan(x) = 2t/(1-t^2)
Reduce to the same denominator (1-t^2)*(1+t^2) etc....
How is that simple? 😂
@@drpeyam It is simple because the trig formula are well known and no complex theory to manage
Not that well known tbh
@@drpeyam Are you kidding me? It's so well known that it actually has a name: the Weierstrass substitution and it's used all the time in evaluating integrals of trigonometric functions.
It really isn’t used that often 😂 I never had to use it in my life
another method is to transform it into tan(theta/2) form which also gives a quartic
sinx + cosx + tanx = -1 or 1 will give you much much nicer solutions, which will yield exact values which won't require resorting to numerical techniques
😝
Given that the first few steps seemed to make things more complicated what would prompt someone to make these steps. I always feel the why (as opposed to the how) of such steps are left undiscussed in maths videos.
That’s a valid point, but this is very standard when you deal with unsolvable real equations, especially those that involve trig. Check out my cos = 2 and related videos for easier examples
Loved the cultural reference! 😄
It's amazing. If you explain such stuff, I can follow it. :)
"Multiples of Tau" is a lot more elegant!
7:34 -- Wolfram Alpha is Friend. ^.^
Is there a method without Ferrari formula?
Ferrari formula? 😂
@@drpeyam quartic formula
Oh I see! I’m not sure but I doubt it
@@drpeyam thank you!
I love your videos, learning a lot of new things from them
Thank you 😊
You made a mistake in 4:36
where you made (4i)z^3 into the other side without changing the sign
Which I correct in the next step…
@@drpeyam I'm sorry i kept waiting for you to notice and you didn't so left after
Anyway thank you very much for your effort i really appreciate the content you provide you and other youtubers about maths
the quartic in the end is pretty symmetric. Couldn't we solve it like we do symmetric quartics in real no.s.
"Like what bprp says, I don't like to be on the bottom" 😂😂😂😂
Where did the +1 go after he multiplied by the denominators?
Full bridge rectifier!
Creo que existen 3 matemáticos que ahora (para mí) Son los Dioses del aprendizaje en TH-cam :
El blackpenred , Derivando y Usted Dr. Peyam .
Muchas gracias por su sabiduría y el amor que le entrega a las matemáticas a la Hora de enseñar en TH-cam !
Saludos
Gracias!!
Wasn't it easier to use parametric formulas?
I don’t think so
What if we had gotten no roots on the unit circle?
Then there wouldn’t be a solution to the equation
I like the special effects 😅👍👍 and your “Körper”.
I've already cracked Fermat's Last Theorem...If I get lucky I believe I can crack this too...
I like that you mentioned that there is an exact solution to the problem and only approximated for aesthetic reasons. Otherwise there would be no reason to use Newtons method right away. (This is the way I would "solve" the equation since I am just a physicist :-))
Exactly!
Thanks!
Amazing !!! 😆😆
I've a nice one i found by chance:
atan(1)+atan(2)+atan(3) = π
I like that!
terrible method...just let u=\tan(x/2) and you get a nicer polynomial equation 3u^4-2u^2+4u-1=0 which only has two real solutions but still not easy to solve. But it is much shorter route than shown in the video
My method is great and much more intuitive, it’s not all about length 😤
Pfft. So much fuss at the beginning to only resort to numerical solver at the end.
I still think it’s really enlightening
@@drpeyam It is enlightening indeed. It shows how to make things complex, forgive the pun. Substitution z=cos(x) quickly leads to the quartic equation 2z^4-2z^3+4z^2-2z-1=0. The resulting polynomial is concave up over the reals, and changes sign on the intervals [-1/4,-1/3] and [2/3,1] thus having exactly two real roots.
Oooh I like this as well!!
7:50 AN AMOGUS REFERENCE?
how come when I go to desmos to graph this, it has infinite solutions? :(
Watch the whole video :)
Great maths. I love it.
It can be solved with a 4th degree equation with real coeff. No i's till the end.
s + c + s/c = 2;
sc + c^2 +s = 2c;
c^2 + s(c+1) - 2c = 0;
c^2 + sqrt(1-c^2)(c+1) - 2c = 0; // all c's
sqrt(1-c^2) = (2c - c^2) / (c+1) = c(2-c) / (c+1);
1-c^2 = +- [ c^2 * (2-c)^2 / (c+1)^2 ];
....
2c^4 -2c^3 + 4c^2 -2c - 1 = 0
K
Makes sense to me and a better solution.
I am confused why the values of Z must lie on the unit circle?
If z = exp(ix) = cos(x) + i sin(x) then |z| = 1
Euler's formula, e^ix, produces circles in the real/imaginary plane.
Nice!
It was interesting.. But complex no (or say complex maths) ruined it (or say make it more fun). 😆😅😉😜
great solution
Next: sinx^arcsinx = i
7:55 AMOGUS
My main man.
is impossible, for example sin(45) +cos(45)+tan(45)=2.4
Very nice
Das es gut. Danke.
Gern geschehen 😁
in the upcoming second part of this outrageousness we'll see that those impostors along with two others from cosh+sinh+tanh point to where Mjollnir is buried. I bet.
Hahaha
Hmm..Let me see...
The circumfence of an ellipse (c) has the relation to half the short axis (a) and half the long axis (b) as follows:
1) b^2 = a^2 + c^2
Now I think You are wrong in accusing Pythagoras of something he is innocent of. I think You should solve the equation for c^2:
2) c^2 = b^2 - a^2 = (b-a) * (b+a)
Now somebody (a schoolteacher on TH-cam) told me that the area of and ellipse is
3) area = pi * a * b
That is all fine and dandy; but there is NO FORMULA for the circumfence of an ellipse expressed by the short and the long axis.
Now I don't quite follow your argument, my dim wit won't allow it. But where I wonder is: What the devil happened to pi??? Where did You pull the plug on pi, so it disappeared into the sewer.
Intuitively the formula seems to be splendid, but You jump a few steps to many for me to understand.
If indeed You are right it solves one of the more fundamental physics problems. (personally I came across it when I wanted to calculate the surface of a submarine. That is the surface of the ellipsoid - roughly.
Johannes Kepler had a devil of a problem, when he proposed his three laws. Planetary orbits are ellipses with the sun in one focus. (here I allways wondered - what happened to the other focus).
The problem here is calculus:
As a planet moves away from the sun the speed decreases (and the kinetic energy = ½ * m * v^2) and simultaneously the potential energy (which - as I recall - is distance * mass) increases, and the conservation of energy requires that the sum of the two is constant.
The next problem is that electrons around a nucleous has the same problem - though here it is the electromagnetic forces that replaces gravity. The solution here is to run with approximations.
What does that have to do with this video?
wait, you transformed it into a more unpleasant equation and then used wolfram alpha to solve it. want my money back ......
Tofay I learned Dr. πm is team tau
Gee I must be stupid, I looked at my slide rule and got 32 degrees, it seemed to add up!
You need a modern digital slide rule my friend, its 31.91deg.🤣
@@tomctutor If you give a result not in radians you are regarded as a troglodyte anyway!
Mir gefällt🖤Ihr “Körper” T-Shirt👕
Thank you!!!
Among us preference.
Ohh, that title: cos, sin, tan without a variable...grrrrr
I mean did you click or not? 😂😂
@@drpeyam I have not seen the WHOLE video. Also, some others pointed out a POTENTIAL error at 4:36, did you look into that? I may dig into it later today...
You should watch the whole video, it gets fixed on the next step
"Körper" LOL
An approximative solution is not a good solution.
Here it is, you can always plug into the quartic formula if you want
i cant help laughing when u speak
I love the amogus
Srry to say I didn't find it interesting you have just did a calculation what new things to learn.
Correct me if I am wrong
It’s like saying math isn’t interesting 🤨
@@drpeyam no you have not understood actually I am also a student from maths bagground.
My question is very simple what is the motivation behind the problem I find only calculation which I guess to a student who have basic knowledge in Complex Analysis
I think if you put sinx=(2tan(x/2)/1 +tan^2(x/2)) and Cosx =( 1- tan^2(x/2))/(1+ tan^2(x/2))
tan(x)=( 2tan(x/2)/1 - tan^2(x/2))
And proceed as you have did you will also get a poly and calculations will be easy i.e. my little memory is saying
Such an intuitive way of doing it 🙄
Bro wtf you can call yourself a doctor u don't even know that only sin is nothing in maths sin(x) is smthng yet you are using sin in your thumbnail sin means mortal act like you are doing
😂
On the first sight answer seems to be real so why complex numbers ?
Why not, everyone here (except the electricians) seem to be adverse to using the full power of (a+ib). Poor Euler underrated.
Wow
Amogus