How can I factorize a quadratic with decimals?

  • Thread starter simpComp
  • Start date
  • Tags
    Quadratic
In summary: Give it a shot!In summary, the speaker is asking for help with factoring a quadratic equation and mentions a tool in Excel that can help. Another person responds with a general equation for solving quadratic equations and suggests using a quadratic formula solver. The speaker then talks about trying to enter the equation into a micro-controller and mentions potential issues with using fractions. They also discuss using a different method for solving the equation and mention using a higher degree polynomial for more accurate results. They ask for assistance in finding a formula that can calculate x values for any given y value.
  • #1
simpComp
44
0
Hello,

Help! I am stuck again :frown:

Okay, I vaguely remember how to factorize the following:

0 = 2x^2 + 5x - 7

The above is easy since all we have to do is find two numbers that when multiplied together gives us -14, and
we have to find two numbers that when added together gives us 5, hence, 7 and -2!

So it becomes:

(2x+7) (x-1)

Now I need to do the same factorization but for this:

114 = -0.026x^2 + 1.928x + 90.96
-0.026x^2 + 1.928x -23.04 = 0

Here, I have to find two numbers that when multiplied together gives us (0.026*-23.04) 0.59904 and
we have to do is find two numbers that when added together gives us 1.928... how do I find that :cry: :cry: :cry:

Is there a mathematical tool in Excel that can do this for me?

Once I can factor my equation I can come up with an equation where I can solve for x every time!
So no matter what y is, I can plug y into an equation and figure out x. :smile:

thanks for your help!
 
Last edited:
Mathematics news on Phys.org
  • #2
There is a general equation for the solutions of a quadratic equation. If x1 and x2 are solutions, your equation is equivalent to (x-x1)(x-x2)=0.
 
  • #3
You could always try completing the square. So for your "simple" example your equation is

2x2 + 5x - 7 = 0

x2 + 5x/2 - 7/2 = 0

(x+5/4)2 -7/2 -25/16 = 0

(x+5/4)2 -81/16 = 0

(x+5/4) = ± 9/4; so x =?

Can you do similar for your advanced one?

Alternatively, try something like http://mathportal.org/calculators/solving-equations/quadratic-equation-solver.php ?
 
  • #4
thanks sjb-2812,

Okay I tried it with the calculator and it does work... please view attachment... GAWD! this reminds me of high school and college! To bad I don't have much time to review this stuff.

Any how, I would have to now find a way to enter this in my micro-controller so that, given any 'y' value I would be able to solve for 'x2'.

Thanks for your help!
 

Attachments

  • QuadFact.jpg
    QuadFact.jpg
    24.5 KB · Views: 389
  • #5
simpComp said:
thanks sjb-2812,
Any how, I would have to now find a way to enter this in my micro-controller so that, given any 'y' value I would be able to solve for 'x2'.

You should be aware that the quadratic formula as usually presented can be numerically ill conditioned in some cases. The formula can be manipulated into a version that is less subject to such problems.

A quick trip to Google found a reference near the bottom of http://introcs.cs.princeton.edu/java/91float/

Look for item 17 there.
 
  • #6
Well as shown in example calculator.. is it okay if I always put it in terms of a fraction and then multiply every term by the lowest common denominator as done in this case by 500?
 
  • #7
simpComp said:
Well as shown in example calculator.. is it okay if I always put it in terms of a fraction and then multiply every term by the lowest common denominator as done in this case by 500?

The idea is to make the equation simpler, or easier to manage its solution. There are rational coefficients and since 500 is the lowest common denominator, multiplying both sides of the equation by 500 will clear the fractions.
 
  • #8
Hello fellows... I am having a hard time... jeeeze doing math once every 5 years is not fun!

Therefore I have tried sticking with the quadratic... since I won't be going with very much small numbers anyways... and also for simplicity. The completing the square way... is long in terms of programming... for now I will try the quadratic.

The idea is to make the equation simpler, or easier to manage its solution. There are rational coefficients and since 500 is the lowest common denominator, multiplying both sides of the equation by 500 will clear the fractions.

okay

So, I have tried two points on my graph and one works out but the other doesn't.

Given by Excel calculator here is the equation of the graph in Q1 attachment:

y = -0.026x^2 +1.928x + 90.96

In Q2 I used the quadratic formula to solve for x when y = 114. The result was very close to 14 which is quite acceptable. However, in Q2, when I tried to solve for x when y = 126, x was way off.. does someone see something I am doing wrong. I was supposed to get 38.. instead I calculated 31 ? Also, I did another point at: (30, 124)... when I tried to solve for x when y is 124, I get 26.8" instead of 30". Why is it so imprecise ?

Also, I was wondering if the equation:

y = -0.026x^2 +1.928x + 90.96

can be used to figure out a y value of 140?? Because, that's what I need, I may require to go further on the x-axis then what the graph shows... :blushing:
Therefore I don't know if a quadratic is right here... confused!

In summary, the x-axis can go til about 240 inches when the y-axis is about 155 steps. I need a formula that no matter what the y value is, I can figure out the respective x value!
Here, in the office I can test up to about 54" max... but based on these values, isn't there a way that we can get a formula that will allow calculations up to when y = 155 steps?

PS. Please note that for these calculations, I didn't bother finding a common denominator as the calculator does at: http://mathportal.org/calculators/so...ion-solver.php [Broken] ?

Thanks for all help!
 

Attachments

  • q1.jpg
    q1.jpg
    29.3 KB · Views: 471
  • q2.jpg
    q2.jpg
    24.3 KB · Views: 462
  • q3.jpg
    q3.jpg
    20.6 KB · Views: 352
Last edited by a moderator:
  • #9
SimpComp,

Not yet having looked at your q1,q2,q3 images yet, but having read of your checked values not conforming to all of your data, you may be able to obtain more reliable curve fitting using a higher degree polynomial. You only need to form the proper matrices and learn to use software technology for matrix handling, mostly for making "reduced row echelon" forms for your matrices. The programs can be your/a graphing calculator or an online web-based tool.

Back from your quadratic fit tries for your points (130,38) (132,30) (136,22) (142,14) (155, 6); you need to choose a combination of any THREE points to form a system of equations, make the matrix, and ... solve the system (meaning, you can use some technology to row reduce the matrix). I tried solving this system and I found two good combinations of data points and one bad combination of data points. I looked at how each solved system would work when I use the model to see how every point of the original data works in calculation. How well does each data point satisfy the modeled equation?
One of the good models was like, y=0.0554x^2-17.06x+1320

One thing you need to know by your own experience is, how consistant are your measurements for Steps and Distances From The Sensor? Do they give precisely the same results every time, or do they change every time you use the same Steps?
 
  • #10
can be used to figure out a y value of 140?? Because, that's what I need, I may require to go further on the x-axis then what the graph shows...
Therefore I don't know if a quadratic is right here... confused!

Visually, in image q1, a parabolic fit seems like a good choice. Notice, you have FIVE points to choose from. You only need a combination of ANY THREE points to find a model. Try a few different combinations of points and then check how each resulting model give computations that are near or not near.
 
  • #11
Okay symbolipoint,

First and foremost, I want to thank you for your help and patience with me.

I have made some recent changes based on your suggestions. I re-calibrated my power supplies and swapped the axis of inches and steps. I think this will be easier if I solve for x from a given form of quadratic equation such as:

ax^2 + bx + c

Also I re-measured all the distances and this time I checked them 3 times each to make sure that they weren't changing on me.

The values are a little different since the power supplies have been meticulously adjusted. Please view the new graph copied from Excel. The new equation is now:

y = 0.054x^2 - 11.84x + 656.4

I now solve for x directly with this equation... I think this is much simpler for me. Therefore,
for a certain step value of 'x' I can solve the respective distance as y just by plugging in x in the above equation!

So, based on the above equation, I have tried calculating certain coordinates as shown in my other attachments. I tried the following coordinates:

(110,6)
(125,22)
(135,38)
(137,54)

I notice though that the higher I go in step wise 'x', the more error is in the distance?

I don't understand why this cannot be more precise?

Another thing is, what is the R2 in Excel's graph?? >>> Root #2 ?

The only thing is, if I try to solve for 150 steps... I would not know how off my distance is... cause I don't have enough room in my office to try such a distance LOL!
But given the amount of error in the above coordinates, I don't think I can trust this equation for greater distances than 54"...
given the fact that already at this distance I am off 6 inches!

Also, in the Excel graph, which doesn't the line stretch til the last coordinate (137, 54) ?? :confused:

In any case, if you can, please get back concerning these issues... It would be greatly appreciated! :blushing:

thanks so much for your assistance!

Thanks all!
 

Attachments

  • C10.jpg
    C10.jpg
    42.8 KB · Views: 407
  • Calc1.jpg
    Calc1.jpg
    22.6 KB · Views: 350
  • Calc2.jpg
    Calc2.jpg
    15.5 KB · Views: 441
Last edited:
  • #12
simpComp said:
I don't understand why this cannot be more precise?
Simple: Your data does not follow a parabola.

Another thing is, what is the R2 in Excel's graph?? >>> Root #2 ?
It is a measure of the fit quality. R^2=1 would be a perfect fit, R^2=0.941 shows that your data deviates from the fitted function.

Also, in the Excel graph, which doesn't the line stretch til the last coordinate (137, 54) ?? :confused:
It is plotted up to 137 and the corresponding y-value. You can extend this manually in Excel.


It would be useful to know more about your data source. What do you test/measure? Is there any reason to expect a quadratic formula, or something else?
 
  • #13
Hello mfb,

It is plotted up to 137 and the corresponding y-value. You can extend this manually in Excel.

I tried to click on line and then select the last plotted dot and tried to drag it to the non-plotted dot... but that didn't work ?

It would be useful to know more about your data source. What do you test/measure? Is there any reason to expect a quadratic formula, or something else?

Well, one thing I just noticed, it seems to have to do with Excel! Consider the following graph which I altered a little... It almost pretty much gives a linear line... but its not...
its still a parabola.

However when I use the suggested equation to calculate y for the first point (6, 109) the result is 0.451 " ? Which in respect to the graph is totally erroneous!

Bof! we are supposed to come close to 6"
You can try it yourself !

Weird!

Here is what I tried:

y = 0.009x^2 - 0.272x - 76.83
y = 0.009(109)^2 - 0.272(109) - 76.83
y = 0.451 ? :eek:Thanks!
 

Attachments

  • C11.jpg
    C11.jpg
    33.2 KB · Views: 381
Last edited:
  • #14
simpComp said:
I tried to click on line and then select the last plotted dot and tried to drag it to the non-plotted dot... but that didn't work ?
Well, this is not an Excel help forum, and I don't even know which version you use, but you could try this:
Right-click on the fitted line -> "format trend line" -> "trend line options" -> "forward" -> 2.0 (or other values)
I translated the labels to english, the real names might be different.

However when I use the suggested equation to calculate y for the first point (6, 109) the result is 0.451 " ? Which in respect to the graph is totally erroneous!
That is a result of the finite precision of the given equation - try formulas like
y = 0.0092x^2 - 0.272x - 76.83
y = 0.0094x^2 - 0.272x - 76.83
They all get rounded to 0.009, but give different results if you compute values based on this equations. You can reduce this problem if you use "distance-100" instead of distance in your graph.
 
  • #15
mfb said:
Simple: Your data does not follow a parabola.


It is a measure of the fit quality. R^2=1 would be a perfect fit, R^2=0.941 shows that your data deviates from the fitted function.


It is plotted up to 137 and the corresponding y-value. You can extend this manually in Excel.


It would be useful to know more about your data source. What do you test/measure? Is there any reason to expect a quadratic formula, or something else?

Exactly! Back in my post #9, a suggestion is made that higher order polynomial fit may give better results. I also tried an exponential fit but the resulting model with found values was bad.
 
  • #16
Okay guys... this is what I have came up with!

I played around with the first coefficient and the values are pretty close. Please view the attachment!

Row "K" holds my steps and "L" holds my respective distances actually tested.

Row "O2" to "O11" holds the values actually calculated by the equation.
Note, row "O1" holds the first term coefficient which I played with in order to get the best results possible.

So the whole equation I will enter in my program will be:

f(x) = 0.000731x^2 + 1.619x + 175.6

I have done the tests up to 120" and the equation pretty much holds +/- 2" tolerance. I can't do any physical tests passed 120" b/c my room is too small LOL!

I could try to rely on the equation for distances greater than 120" but I don't know how precise this will be... According to formula if I have 190 steps I would have a distance of 158.3" !

But in any case, for now, if the distance is passed the 120" mark, I will just indicate on my screen:

"> 10 feet" ...

step 158 gives a calculated distance of 98.4" which is the only one that is a little more off than the others (should be 96"). According to this chart of values, how can I specify the error tolerance factor? Can I take the reading with the most error.. for example the 98.4" is the one with the most error, can I express it this way:

Error tolerance worst case scenario:

2.4"/120" = 0.02 or 2% error max

Anyways these tests were done with a solid object. Tomorrow, I will have to try it with a human hand. I expect a different equation since infrared goes through the human hand and results in less infra red bouncing back to the sensor!
 

Attachments

  • FinalCurve_Obj.jpg
    FinalCurve_Obj.jpg
    36.5 KB · Views: 352
  • #17
You are now using a function, f(x) = 0.000731x^2 + 1.619x + 175.6, with such a small coefficient on x^2, and your graph image in the attachment looks like a line. You seem to have an interval of steps for which a linear model will work very, very well. Below ~110 steps, your model may need to be a curve.
 
  • #18
well, I don't need any measurements below 107 steps!

I will look into using a linear model...

thanks for your help
 
Last edited:
  • #19
The ordered pairs shown in your FinalCurve_Obj.jpg image attachment can be plotted onto a cartesian coordinate system, and a best line can be drawn. Any points on the line can be used for finding slope, and several points can be used for finding a y-intercept, an average of these taken, and then this can be used as the best y-intercept. I tried this and found a line to fit as
y=(114/63)x-188

Similar to what you said, near x=148 and x=158, the resulting y deviates about 3 inches from what you expected. Much of the rest of the line is a very good fit.
 
  • #20
Careful with mixing relative and absolute error, the value for 112 steps has a larger relative error.
I agree that 2-3 inch are a reasonable value for a maximal error (not including possible measurement uncertainties), but the relative error can be large for small values in column L.
 

What is factorising a quadratic?

Factorising a quadratic is the process of finding the two numbers that, when multiplied together, result in the given quadratic equation. This is done by breaking down the quadratic into its factors, which can then be rearranged to find the two numbers.

Why is factorising a quadratic important?

Factorising a quadratic is important because it allows us to solve quadratic equations, which are commonly used in many fields of science and mathematics. It also helps us identify the roots or solutions to a quadratic equation, which can have real or imaginary values.

What are the methods for factorising a quadratic?

There are several methods for factorising a quadratic, including the quadratic formula, completing the square, and the "AC" method. The most commonly used method is the "AC" method, where the quadratic is broken down into two factors that multiply to give the original quadratic.

What are the common mistakes made when factorising a quadratic?

One of the most common mistakes when factorising a quadratic is forgetting to take out the greatest common factor (GCF) first before attempting to factorise. Another mistake is not checking if the factors found are correct by multiplying them back together to get the original quadratic. It is also important to be careful with signs and exponents when factorising.

How can factorising a quadratic be applied in real-life situations?

Factorising quadratics can be applied in various real-life situations, such as calculating the trajectory of a projectile, determining the optimal dimensions of a product, and analyzing data in statistics. It is also used in engineering and physics to solve problems involving motion and forces.

Similar threads

Replies
4
Views
737
Replies
1
Views
980
Replies
19
Views
2K
Replies
3
Views
1K
  • General Math
Replies
2
Views
1K
Replies
8
Views
1K
Replies
7
Views
1K
Replies
6
Views
1K
  • General Math
Replies
3
Views
975
Replies
4
Views
825
Back
Top