Derivative and Numerical approach

In summary: However, multiplying a complex number by zero can result in a number that is real or imaginary depending on the phase of the imaginary number.
  • #1
fog37
1,568
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
  • #2
  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.
 
  • #3
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
 
  • #4
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).
 
  • #5
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.
 
  • #6
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.
 
  • #7
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:
  • #8
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?
 
  • #9
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.
 

Related to Derivative and Numerical approach

1. What is a derivative?

A derivative is a mathematical concept that represents the rate of change of a function at a specific point. It measures how much a function changes as its input variable changes.

2. What is the numerical approach to finding derivatives?

The numerical approach to finding derivatives involves using numerical methods, such as the finite difference method, to approximate the derivative of a function at a specific point. This is useful when a function's derivative cannot be found analytically or when a more precise result is needed.

3. What is the difference between analytic and numerical derivatives?

Analytic derivatives are calculated using algebraic techniques, while numerical derivatives are approximated using numerical methods. Analytic derivatives give an exact result, while numerical derivatives are an approximation and can have some error.

4. How does the choice of step size affect the accuracy of numerical derivatives?

The step size, or the distance between data points, affects the accuracy of numerical derivatives. Choosing a smaller step size can lead to a more accurate result, but it also increases the computational cost. On the other hand, a larger step size can result in a less accurate approximation.

5. In what situations would the numerical approach be more useful than the analytic approach for finding derivatives?

The numerical approach is more useful when the function's derivative cannot be found analytically or when a more precise result is needed. It is also useful when dealing with complex functions or when the function has multiple variables. In these situations, the numerical approach can provide a more accurate and practical solution.

Similar threads

Replies
18
Views
2K
Replies
1
Views
293
Replies
1
Views
1K
Replies
5
Views
2K
Replies
5
Views
1K
Replies
4
Views
2K
  • Calculus
Replies
3
Views
2K
Replies
32
Views
3K
Replies
2
Views
727
Replies
1
Views
1K
Back
Top