Trial and error method is very useful concept in science when your are solving difficult equations. It is not a direct method to find a unknown value and consumes lot of time to solve the equation. Also, it will not give the exact answer. But, it will give a reasonable answer to your equation. In this tutorial, we will learn, what is trial and error method and how to apply it to solve difficult equations using hand and using Matlab.
Think we have an equation of x and equation like following one.
x3 + 3x + 1 = 0
There are several steps to follow to solve an equation using trial and error method. Later, we discuss these steps in detail.
As the first assumption, we can assume x as 1. Then substitute it in left side of our equation.
Because, x = 1 was not an answer, lets try another value, x = -1
Because, x = -1 was not an answer too, lets try another value, x = -0.5
However, you can see, our value is being reached towards zero. Let's try one more assumption (x = -0.2) to make sure whether we are going to the right direction.
Now, we can make a table of x values and left side values.
Let's draw a graph using x values and given values for x.
You can see a sign change, when x goes from -0.5 to -0.2. In that range left side value should be zero at some value of x (between -0.5 to -0.2). See the graph to get clear. There may be more sign changes in different ranges like this range.
After, you found a sign change, you can assume numbers between that range to get the optimum answer for x. In this example, now you should assume values for x between -0.5 to -0.2.
This is the procedure of solving equations using trial and error method.