1 Example: Solution of Quadratic Equations We want to solve for real values of x, for given values of a, b, and c. The value of x can be determined from.

Slides:



Advertisements
Similar presentations
C++ for Engineers and Scientists Third Edition
Advertisements

Lesson 1-6 Solving Quadratic Equations. Objective:
7.1 – Completing the Square
4.8 Quadratic Formula and Discriminant
The Quadratic Formula..
1.7 – Linear Inequalities and Compound Inequalities
Solving Quadratic Equations Section 1.3
Bell Ringer: Find the zeros of each function.
Solving Quadratic Equations by the Quadratic Formula
As you come in collect your Warm-Ups to be turned in
Quadratic Equations, Functions, and Models
Section 10.5 – Page 506 Objectives Use the quadratic formula to find solutions to quadratic equations. Use the quadratic formula to find the zeros of a.
5.4 Complex Numbers Until now, you have always been told that you can’t take the square root of a negative number. If you use imaginary units, you can!
1 Chapter 4: Selection Structures. In this chapter, you will learn about: – Selection criteria – The if-else statement – Nested if statements – The switch.
5.6 Quadratic Equations and Complex Numbers
Goals: To solve quadratic equations by using the Quadratic Formula.
Making Decisions Chapter 5.  Thus far we have created classes and performed basic mathematical operations  Consider our ComputeArea.java program to.
1 Problem Solving We now have enough tools to start solving some problems. For any problem, BEFORE you start writing a program, determine: –What are the.
SOLVING QUADRATIC EQUATIONS Unit 7. SQUARE ROOT PROPERTY IF THE QUADRATIC EQUATION DOES NOT HAVE A “X” TERM (THE B VALUE IS 0), THEN YOU SOLVE THE EQUATIONS.
Solving Quadratic Equations – Part 1 Methods for solving quadratic equations : 1. Taking the square root of both sides ( simple equations ) 2. Factoring.
Pre-Calculus Section 1.5 Equations Objectives: To solve quadratics by factoring, completing the square, and using the quadratic formula. To use the discriminant.
Review How do we solve quadratic equations? 1.) Factoring using “Bottoms Up” 2.) if its not factorable by “Completing the Square”
3.8 Warm Up Write the function in vertex form (by completing the square) and identify the vertex. a. y = x² + 14x + 11 b. y = 2x² + 4x – 5 c. y = x² -
Review the following: if-else One branch if Conditional operators Logical operators Switch statement Conditional expression operator Nested ifs if –else.
Objectives: To utilize the Quadratic Formula. To describe the nature of the roots and decide if a quardratic is factorable, using the discriminant. Adapted.
13.4 The Quadratic Formula Objective: 1.)To use the quadratic formula to solve quadratic equations 2.) To use the discriminant to find the number of solutions.
The Quadratic Formula & Discriminant Essential question – How do you solve a quadratic equation using the Quadratic Formula?
Goal: Solve and write absolute value equations in one variable Section 4-4: Solving Absolute Value Equations.
Chapter 3. Control Structures and Program Design ► Two broad categories of control statement:  Branches  Loops ► These will make the program more complex.
Copyright © 2014, 2010, 2007 Pearson Education, Inc. 1 1 Chapter 9 Quadratic Equations and Functions.
More about Quadratic Equations November 16, 2009.
Pre-Calculus Lesson 5: Solving Quadratic Equations Factoring, quadratic formula, and discriminant.
Quadratic Formula You can use this formula to find the solutions(roots) to a quadratic equation. This formula can be broken up into 2 parts: b 2 – 4ac.
The Quadratic Formula Students will be able to solve quadratic equations by using the quadratic formula.
Lesson 1.4 Equations and Inequalities Goal: To learn how to solve equations and check solutions of equations and inequalities.
CHAPTER 4.
Given a quadratic equation use the discriminant to determine the nature of the roots.
4.2 Quadratic Functions Objective: Solve quadratic equations. Use the discriminant to describe the roots of a quadratic equation.
Solve by factoring. x² = - 4 – 5x 2,. Solve by factoring. n² = -30 – 11n -4 and -1.
Solving Quadratic Formula using the discriminant.
Notes Over 5.6 Quadratic Formula
MM2A4. Students will solve quadratic equations and inequalities in one variable. b. Find real and complex solutions of equations by factoring, taking square.
Warm-Up How can you determine whether two lines are parallel or perpendicular or neither? 4.
A-REI.4 Solve quadratic equations in one variable.
Lesson 2-3 The Quadratic Equation Objective: To learn the various ways to solve quadratic equations, including factoring, completing the square and the.
Thought for the day The early bird gets the worm, but the second mouse gets the cheese.
Solving Quadratic Equations by Using the Quadratic Formula (9-5) Objective: Solve quadratic equations by using the Quadratic Formula. Use the discriminant.
Program Control: Selection Subject: T0016 – ALGORITHM AND PROGRAMMING Year: 2013.
Lesson 6.5: The Quadratic Formula and the Discriminant, pg. 313 Goals: To solve quadratic equations by using the Quadratic Formula. To use the discriminant.
C++ for Engineers and Scientists Second Edition Chapter 4 Selection Structures.
4.6 Quadratic formula.
Equations Quadratic in form factorable equations
The Quadratic Formula..
Solving quadratics methods
Do Now – Take out your homework. Take You have 5 minutes.
Complex integers? Here a and b are integers.
Warm-Up.
4.6 Quadratic formula.
Worksheet Key 9 11/14/2018 8:58 PM Quadratic Formula.
The Quadratic Formula..
Solve x2 + 2x + 24 = 0 by completing the square.
5.6 The Quadratic Formula and the Discriminant
4.8 The Quadratic Formula and the Discriminant
Ch3/4 Lesson 9 The Discriminant Nature of the ROOTS
Quadratic Formula & the Discriminant
Review: Simplify.
Quadratic Equations.
Equations Quadratic in form factorable equations
Using the Quadratic Formula to Solve Quadratic Equations
Problem 1 Given n, calculate 2n
Presentation transcript:

1 Example: Solution of Quadratic Equations We want to solve for real values of x, for given values of a, b, and c. The value of x can be determined from the “well- known” formula: Depending on the value of the discriminant we have 3 cases: 1. two real values for x 2. one real value for x 3. no real values for x

2 Flow diagram b 2 – 4ac > 0 b 2 – 4ac < 0 x 1 = – b/2a False No solutions True

3 Flow diagram, version 2 d > 0 d < 0 x 1 = – b/2a False No solutions True d = b 2 – 4ac True

4 Structure of nested if statements discriminant = b * b * a * c; if ( discriminant > 0 ) { // We have two real solutions } else { if ( discriminant < 0 ) { // We have no real solutions. } else { // We have one real solution. }

5 Adding the Complex case Suppose we now want to solve for real or complex values of x, for given values of a, b, and c. In this case, we can still use the formula but when we have we will need to be careful to avoid taking a square root of a negative number. If we take the square root of the absolute value of the discriminant, we have the complex coefficient

6 Flow diagram d > 0 d < 0 x 1 = – b/2a False True d = b 2 – 4ac True

7 Testing for Equality with Floating Point Values Because of the possibility of round-off error, testing for equality (or inequality) of float or double values is NOT recommended. Instead, test that the value is “close enough” to the desired value by using a tolerance value, and checking that the absolute value of the difference is less than the tolerance: double EPSILON = 1.0e-10; double x;... if ( x == 37.0 ) // not recommended... if ( Math.abs( x – 37.0 ) < EPSILON ) // better

8 The switch statement Allows for multi-way branches You can only use case statements when the test is on an integer, Boolean, or character variable. Idea: –List various “cases” for specific values of the tested variable, plus one default case for when there is no match. –Provide a statement block for each case. You MUST end each statement block with break; or the program will go to the next following case.

9 The switch statement case 1 case 2 case n statement block 1 true statement block 2 true statement block n true default statement block false break;

10 Example System.out.println(“Enter an integer from 1 to 3: “); int a = Keyboard.readInt(); switch( a ) { case 1: { System.out.println(“You entered a 1.”); break; } case 2: { System.out.println(“You entered a 2.”); break; } case 3: { System.out.println(“You entered a 3.”); break; } default: { System.out.println(“Incorrect input.”); break; } System.out.println(“After switch.”); }

11 Missing break statement case 1 case 2 case n statement block 1 true statement block 2 true statement block n true default statement block false break;