Find the solution of a quadratic equation by programming!

Updated on educate 2024-02-09
14 answers
  1. Anonymous users2024-02-06

    vb wants to control oh add it yourself.

    **:private sub command1_click()dim a, b, c, delta, x1, x2, x as double

    a = val(

    b = val(

    c = val(

    if a = 0 then

    The quadratic coefficient is 0 and is not a quadratic equation"

    end if

    delta = b * b - 4 * a * c ‘b^2-4ac= "b^2-4ac=" & delta 'This sentence can be left out.

    if delta = 0 then

    x = (-b) / 2 * a

    The equation has two identical real roots x=" & xend if

    if delta > 0 then

    y = sqr(delta) 'b 2-4acx1 under root number = (y - b) 2 * a

    x2 = (-b + y)) / 2 * a= x1 & x2

    end if

    if delta < 0 then

    Equations have no real roots"

    end if

    end sub

  2. Anonymous users2024-02-05

    Microsoft C++.

    #include

    #include

    using namespace std;

    int main()

    double a,b,c;

    double delta,x1,x2;

    int sign;

    cout<<"The unary quadratic equation a*x*x+b*x+c=0";

    cout<<"Enter three coefficients a(a!).=0),b,c;"<>a>>b>>c;

    cout<<"a="<0)

    sign=1;

    else sign=0;

    delta=sqrt(fabs(delta));

    x1=-b/(2*a);

    x2=delta/(2*a);

    if(sign)

    cout<<"The equation has two different real roots:"

    Anonymous users2024-02-04

    From Eq. (l):

    x=50-y(3).

    Substitute Eq. (3) into Eq. (2).

    25 (50 a y) ten 35y = 14500

    1250-25y-ten35y=14500

    10y=13250

    y=1325

    Substitute y=1325 into equation (3).

    x = 50 a 1325

    x = a 1275

  3. Anonymous users2024-02-03

    The general method of solving a quadratic equation is of course to solve it directly by the formula method, which is applicable to all quadratic equations, but it is not the easiest method.

    In fact, when we solve a quadratic equation, we should adopt the corresponding method according to the characteristics of the equation, so as to improve the efficiency of solving the problem

    1) Root-finding formula method, applicable to all one-dimensional quadratic equations;

    2) Factorization, the equation is deformed into the form of (x-x1)(x-x2)=0, so that x-x1=0 and x-x2=0 obtain the two roots of the equation.

    3) Matching method: The matching method is also suitable for solving all one-dimensional quadratic equations. The method is not described separately.

    4) Direct opening and leveling method: When both sides of the equation are perfectly squared, you can directly square both sides of the equation and take positive and negative.

    According to the characteristics of different equations, choose different methods to achieve twice the result with half the effort!

  4. Anonymous users2024-02-02

    There is no one fixed method, only flexibility.

  5. Anonymous users2024-02-01

    There are generally two common solutions to binary equations:

    1.Substituting the elimination method: 2, addition and subtraction elimination method.

    1.Substitution of the elimination method.

    Substitution elimination method: Turn the coefficient of an unknown number of one of the equations into 1 and substitute it into another equation.

    For example: 2x+y=9

    5x+3y=21②

    Solution: Derive: y=9-2x

    Substituting "gets: 5x+3(9-2x)=21".

    5x+27-6x =21

    5x-6x = 21-27

    x = 6x =6

    Substituting x=6 yields: y=-3

    The solution of the system of equations is x=6 y=-3

    2.Addition, subtraction, and elimination method uses the properties of the equation to make the absolute value of the coefficient before one of the two unknowns in the equation system equal, and then add (or subtract) the two equations to eliminate the unknown, so that the equation contains only one unknown and can be solved.

    3x+2y=7 ①

    5x-2y=1 ②

    Solution: 3x+5x)+2y+(-2y))=7+1)8x=8

    x=1 substitute x : 3x+2y=7

    3×1+2y=7

    2y=4 y=2x=1

  6. Anonymous users2024-01-31

    Binary equations, if you really don't know how to solve them, then use the root formula, but sometimes it can be very troublesome and complicated. After all, you can't use a calculator during the exam. Find the memory of the root formula, if you use it too much, you will naturally remember it.

    But it's best to try your best to learn how to multiply crosses! This would be convenient, if applicable. There is also learning how to trim, which is necessary!

    If you really don't understand, then dissect the example problem!

  7. Anonymous users2024-01-30

    All the formulas can be solved, which is -b+- root number... As for memory, it's OK to use it a few more times.

  8. Anonymous users2024-01-29

    Listen to the teacher and do a few simple ways to find it.

  9. Anonymous users2024-01-28

    First of all, this is not a quadratic equation, but a quadratic inequality!

    Solution: f'(x)=3(x^2)-6x-9

    3[(x 2)-2x-3] (Factorization: Extracting the common factor 3) = 3(x+1)(x-3) (Factoring: Cross multiplication) 1, by f'(x) 0, there is:

    x+1)(x-3) 0 i.e.: x+1 0, x-3 0.........1) Or: x+1 0, x-3 0.........2) By the group of inequalities (1), there are:

    x -1, x 3, get: x 3 by the inequality group (2), have: x -1, x 3, get:

    x -1 is combined to obtain: x 3, or: x -1;

    2. By f'(x) 0, there is: (x+1)(x-3) 0 can be seen: x+1 and x-3 must have different signs, i.e.: x+1 and x-3 must be one positive and one negative).

    Obviously: x-3 x+1

    So: x+1 0, x-3 0

    Solution: x -1, x 3

    i.e.: -1 x 3.

    Do you understand?

  10. Anonymous users2024-01-27

    In the end, there are two ways. 1, using the root finding formula 2, multiply the crosses.

  11. Anonymous users2024-01-26

    First of all, factorization! Then let each term be equal to 0 to get x.

  12. Anonymous users2024-01-25

    3x-5y=-2

    2x+7y=40

    6x-10y=4 1

    6x+21y=120 2

    2-1 Laugh Wood.

    31y=116 y=116 Excavation section 31

    Substituting 1 x = 642 93

  13. Anonymous users2024-01-24

    There are generally two ways to do this.

    For example, solution x+y=8 1).

    3x+y=12 2)

    Method 1: Substitution equation method.

    Obtained from (1).

    y=8-x 3)

    Replace (3) with (2).

    3x+(8-x)=12

    x=2 and then replace x=2 back to (1).

    Get 2+y=8

    y=6 Method 2: Addition and subtraction equation method.

    2) Formula - (1) Formula.

    Get 2x=4x=2 and substitute x=2 back to (1).

    Get 2+y=8

    y=6 In general, the first type is used.

Related questions
8 answers2024-02-09

if (b*b-4*a*c==0)

printf("x1=x2=%.6f",-b/(2*a)); >>>More

14 answers2024-02-09

An equation that contains only one unknown, and the order of the highest order term containing unknowns is one, is called a univariate equation. >>>More

18 answers2024-02-09

Since ac squared = bc times ab, x squared = 1-x solution yields the value of x (take a positive value, the length must be positive). >>>More

11 answers2024-02-09

1.Set a daily water supply of x 10,000 cubic meters.

3x+x+1/2x+1= >>>More

7 answers2024-02-09

If the large bottle is x bottle, then the small bottle is y bottle, then there are: 500 * x + 250 * y = (one ton = 1000kg = 1000000g). >>>More