C Program: Source Code for Solving Quadratic Equations.
Quadratic equation - Wikipedia, the free encyclopedia. This article is about single- variable quadratic equations and their solutions. For more general information about the single- variable case, see Quadratic function. For the case of more than one variable, see Conic section and Quadratic form. In elementary algebra, a quadratic equation (from the Latinquadratus for . If a = 0, then the equation is linear, not quadratic. The numbers a, b, and c are the coefficients of the equation, and may be distinguished by calling them, respectively, the quadratic coefficient, the linear coefficient and the constant or free term.
SOLVING QUADRATIC EQUATIONS. This program solves Quadratic Equations. Enter the coefficients in appropiate boxes and click Solve. It will show the results in boxes Root1 and Root2. Enter the Coefficient of X Best Answer: C program /* quadratic.c */ /* Program to evaluate real roots of quadratic equation 2 a x + b x + c = 0 using quadratic formula 2 x = ( -b +/- sqrt(b - 4 a c)) / (2 a) */ #include <stdio.h. A quadratic equation is a second-order polynomial equation in a single variable x ax^2+bx+c=0, (1) with a!=0. Because it is a second-order polynomial equation, the fundamental theorem of algebra guarantees that it. Get the free 'Quadratic Equation Solver' widget for your website, blog, Wordpress, Blogger, or iGoogle. Find more Mathematics widgets in Wolfram
The quadratic equation only contains powers of x that are non- negative integers, and therefore it is a polynomial equation, and in particular it is a second degree polynomial equation since the greatest power is two. Quadratic equations can be solved by a process known in American English as factoring and in other varieties of English as factorising, by completing the square, by using the quadratic formula, or by graphing. Solutions to problems equivalent to the quadratic equation were known as early as 2. BC. Solving the quadratic equation. Plots of quadratic function y = ax. A quadratic equation with real or complexcoefficients has two solutions, called roots.
These two solutions may or may not be distinct, and they may or may not be real. Factoring by inspection. In some cases, it is possible, by simple inspection, to determine values of p, q, r, and s that make the two forms equivalent to one another. If the quadratic equation is written in the second form, then the . Solving these two linear equations provides the roots of the quadratic. For most students, factoring by inspection is the first method of solving quadratic equations to which they are exposed. As an example, x.
Sal solves the equation -7q^2+2q+9=0 by using the quadratic formula.
The more general case where a does not equal 1 can require a considerable effort in trial and error guess- and- check, assuming that it can be factored at all by inspection. Except for special cases such as where b = 0 or c = 0, factoring by inspection only works for quadratic equations that have rational roots. This means that the great majority of quadratic equations that arise in practical applications cannot be solved by factoring by inspection. For the quadratic functiony = x.
These result in slightly different forms for the solution, but are otherwise equivalent. A number of alternative derivations can be found in the literature. These proofs are simpler than the standard completing the square method, represent interesting applications of other frequently used techniques in algebra, or offer insight into other areas of mathematics.
A lesser known quadratic formula, as used in Muller's method, and which can be found from Vieta's formulas, provides the same roots via the equation: x=. By contrast, in this case the more common formula has division by zero in both cases. Reduced quadratic equation. This is done by dividing both sides by a, which is always possible since a is non- zero.
This produces the reduced quadratic equation. This monic equation has the same solutions as the original.
The quadratic formula for the solutions of the reduced quadratic equation, written in terms of its coefficients, is: x=1. Discriminant signs. In the quadratic formula, the expression underneath the square root sign is called the discriminant of the quadratic equation, and is often represented using an upper case D or an upper case Greek delta. In this case the discriminant determines the number and nature of the roots. There are three cases: If the discriminant is positive, then there are two distinct roots. For quadratic equations with rational coefficients, if the discriminant is a square number, then the roots are rational.
Rather, there are two distinct (non- real) complex roots. In these expressions i is the imaginary unit. Thus the roots are distinct if and only if the discriminant is non- zero, and the roots are real if and only if the discriminant is non- negative. Geometric interpretation.
As a result, the path follows quadratic equation y=a. The a value should be considered negative here, as its direction (downwards) is opposite to the height measurement (upwards). The function f(x) = ax. The location and size of the parabola, and how it opens, depend on the values of a, b, and c. As shown in Figure 1, if a > 0, the parabola has a minimum point and opens upward. If a < 0, the parabola has a maximum point and opens downward.
The extreme point of the parabola, whether minimum or maximum, corresponds to its vertex. The x- coordinate of the vertex will be located at x=. The y- intercept is located at the point (0, c). The solutions of the quadratic equation ax. As shown in Figure 2, if a, b, and c are real numbers and the domain of f is the set of real numbers, then the roots of f are exactly the x- coordinates of the points where the graph touches the x- axis. As shown in Figure 3, if the discriminant is positive, the graph touches the x- axis at two points; if zero, the graph touches at one point; and if negative, the graph does not touch the x- axis.
Quadratic factorization. Graphing calculator computation of one of the two roots of the quadratic equation 2x. Although the display shows only five significant figures of accuracy, the retrieved value of xc is 0. For most of the 2. Students learned to solve quadratic equations by factoring, completing the square, and applying the quadratic formula.
Recently, graphing calculators have become common in schools and graphical methods have started to appear in textbooks, but they are generally not highly emphasized. The skills required to solve a quadratic equation on a calculator are in fact applicable to finding the real roots of any arbitrary function. Since an arbitrary function may cross the x- axis at multiple points, graphing calculators generally require one to identify the desired root by positioning a cursor at a . In this context, the quadratic formula is not completely stable. This occurs when the root have different order of magnitude, or, equivalently, when b. In this case, the subtraction of two nearly equal numbers will cause loss of significance or catastrophic cancellation in the smaller root. To avoid this, the root that is smaller in magnitude, r, can be computed as (c/a)/R.
This can lead to loss of up to half of correct significant figures in the roots. The other solution of the same equation in terms of the relevant radii gives the distance between the circumscribed circle's center and the center of the excircle of an ex- tangential quadrilateral. History. There is evidence dating this algorithm as far back as the Third Dynasty of Ur.
This is essentially equivalent to calculating x=p. The Egyptian Berlin Papyrus, dating back to the Middle Kingdom (2. BC to 1. 65. 0 BC), contains the solution to a two- term quadratic equation. Babylonian mathematicians from circa 4. BC and Chinese mathematicians from circa 2.
BC used geometric methods of dissection to solve quadratic equations with positive roots. Euclid, the Greek mathematician, produced a more abstract geometrical method around 3.
BC. With a purely geometric approach Pythagoras and Euclid created a general procedure to find solutions of the quadratic equation. In his work Arithmetica, the Greek mathematician Diophantus solved the quadratic equation, but giving only one root, even when both roots were positive. Al- Khwarizmi goes further in providing a full solution to the general quadratic equation, accepting one or two numerical answers for every quadratic equation, while providing geometric proofs in the process. The quadratic formula covering all cases was first obtained by Simon Stevin in 1. The first appearance of the general solution in the modern mathematical literature appeared in an 1. Henry Heaton. Graph of the difference between Vieta's approximation for the smaller of the two roots of the quadratic equation x. Vieta's approximation is inaccurate for small b but is accurate for large b.
The direct evaluation using the quadratic formula is accurate for small b with roots of comparable value but experiences loss of significance errors for large b and widely spaced roots. The difference between Vieta's approximation versus the direct computation reaches a minimum at the large dots, and rounding causes squiggles in the curves beyond this minimum. Vieta's formulas give a simple relation between the roots of a polynomial and its coefficients. In the case of the quadratic polynomial, they take the following form: x.
Since the graph is symmetric with respect to a vertical line through the vertex, when there are two real roots the vertex's x- coordinate is located at the average of the roots (or intercepts). Thus the x- coordinate of the vertex is given by the expressionx. V=x. 1+x. 22=. Figure 5 shows the difference between (i) a direct evaluation using the quadratic formula (accurate when the roots are near each other in value) and (ii) an evaluation based upon the above approximation of Vieta's formulas (accurate when the roots are widely spaced). As the linear coefficient b increases, initially the quadratic formula is accurate, and the approximate formula improves in accuracy, leading to a smaller difference between the methods as b increases. However, at some point the quadratic formula begins to lose accuracy because of round off error, while the approximate method continues to improve.
Consequently, the difference between the methods begins to increase as the quadratic formula becomes worse and worse. This situation arises commonly in amplifier design, where widely separated roots are desired to ensure a stable operation (see step response). Trigonometric solution. Tables of logarithms and trigonometric functions were common in math and science textbooks. Specialized tables were published for applications such as astronomy, celestial navigation and statistics.