I Derivative and Numerical approach

fog37
Messages
1,566
Reaction score
108
Hello,

I am dealing with a function f(x) involving various complicated trig functions. I took the first derivative of the function f(x), which is doable, and set it to zero to find the at which value x the function f(x) would be maximum. However, once I have the derivative of f(x), it does not seem possible to isolate x and solve for it...

What does it mean to solve the problem numerically? Does it simply mean taking the function representing the derivative, plugging in a series of x values, and searching for the value(s) that make the function zero?

Thanks
Fog37
 
Physics news on Phys.org
  1. The first step is to make a graph of the function and it's derivative. This will give you an approximate answer for where the maximum is. Then you can apply a method like the Newton-Raphson method to find the value where the derivative is zero. If you have the function programmed into a computer, which you will probably need to do to make a graph, it's also possible to just do a binary search to find the maximum. You take two values on either side of the max, which you can find by looking at the graph, and just keep dividing the interval in half until you find the maximum to the desired accuracy.
 
Thank ou phyzguy.

what if I just plotted the derivative and then wrote a MATLAB routine to search for the zero or lowest value? I wouldn't need to do any numerical method in that case, right?fog37
 
fog37 said:
what if I just plotted the derivative and then wrote a MATLAB routine to search for the zero or lowest value? I wouldn't need to do any numerical method in that case, right?
Matlab is working with numbers here, rather than symbolically finding an answer. By writing a MATLAB routine, you are indirectly using numerical methods to find the zero (or lowest value).
 
fog37 said:
What does it mean to solve the problem numerically?

Is everybody clear as to what the OP means by "solve the problem?" I never saw a statement of what the problem is, so I'm not sure what he wants. Is he looking for a zero of the original function, or something else? Taking a derivative may be useful for applying Newton's method to that, but finding a zero of the derivative is not.
 
Dr.D said:
Is everybody clear as to what the OP means by "solve the problem?" I never saw a statement of what the problem is, so I'm not sure what he wants. Is he looking for a zero of the original function, or something else? Taking a derivative may be useful for applying Newton's method to that, but finding a zero of the derivative is not.
fog37 said:
I am dealing with a function f(x) involving various complicated trig functions. I took the first derivative of the function f(x), which is doable, and set it to zero to find the at which value x the function f(x) would be maximum.
So, he would like to solve for the zeros of the derivative in order to determine the maximum of the original function. In order to do this using Newton, he would have to compute the second derivative numerically or symbolically.
 
Most non-linear optimization methods will not solve for zeros of the derivative of f(x). Instead, they start at a value of x=x0 and use the derivative f'(x0) to direct them to a second guess, x1. The process is repeated at x1 to move to a better x value, x2. The algorithm continues iterating to better values of xn till a termination criteria is achieved.

PS. If the algorithms do not solve for zeros of f'(x), they often do approximate f' with a linear or second order function that they do solve for zero. That can speed up the iterative process.
 
Last edited:
Thank you everyone for the insight.

I have made some progress working on the derivative function which results now to be the product of two sub-functions. By finding the zeros of each sub-function would I also automatically find the zeros of the entire function? In general, are the zeros of the multiplied functions also the zeros of the entire function?
 
Yes, as long as the other factors do not go to infinity at the same location. Multiplying any real number by zero gives a zero.
 

Similar threads

Back
Top