How can I numerically solve for f(q) using only its derivative, f'(x)?

In summary, the speaker is looking for a way to solve a problem numerically by using the derivative of a function to approximate its value at a certain point. They have found that for certain situations, such as when the function equals the integral of its derivative, this method works. However, they are unsure of how to handle cases where the function and its derivative both equal zero at the point of interest. They are asking for suggestions or a known algorithm to solve this problem.
  • #1
2
0
I have tried searching and have not come up with an answer to this question - but have come close in my own work (i think). Note: I want to solve this numerically, or by some formula.

I am trying to solve this problem, save I have function [tex]f(x)[/tex], the equation is not known. Its derivative, [tex]f'(x)[/tex], is known.

I want to find the value of at q, [tex]f(q)[/tex], using its derivative. I have been searching for an algorithm or formula for this and all of my results have been off topic (getting results about general integration rules, which is not what I want).

For situations similar to [tex]f'(x)=x^n[/tex], where n is a constant, the equation
[tex]f(q)=\int_{0}^{q}x^n[/tex]
is accurate. And indeed, for any derivative [tex]f'(x)[/tex] where [tex]f(0)=0[/tex], this is true. And I know this since
[tex]\int_{a}^{b}f'(x)=f(b)-f(a)[/tex]
However this does not work on all [tex]f'(x)[/tex], and I can not test if [tex]f(0)=0[/tex] since I do not have its equation, and am solving numerically.

After some thinking and work, I cam up with
[tex]f(q)=(\int_{0}^{q}x^n)+f'(0)-1[/tex]
This works on many other equations. Such as
[tex]f'(x)=e^{-x^{2}}[/tex]
&
[tex]f'(x)=cos(x)[/tex].

However it does not work over all, and believe it will fail when [tex]f(0)=f'(0)=0[/tex]. As I've tested a few such as
[tex]f'(x)=x^3[/tex]
which will fail under my new formula ([tex]f'(0)=f(0)=0[/tex]).
[tex]f'(x)=atan(x)[/tex]
will also fail, ([tex]f'(0)=f(0)=0[/tex])

However the problem remains that I can not check if [tex]f(0)=0[/tex], especially since I'm solving for f(q) in the first place! (since [tex]0\in\Re[/tex]). As far as i can tell, my new formula will work so long as [tex]f'(0)=f(0)=0[/tex] is not true, which means if I could some how test for [tex]f(0)=0[/tex] I would have the problem solved (well for the most part, I don't have a proof, but would be a well tested heuristic).

I think I've fully explained what I'm trying to do - if it is unclear please ask and I will try to be more specific, and if anyone knows the solutions or has an idea please let me know! (or if this is in the wrong thread)
 
Physics news on Phys.org
  • #2
?? I have no idea what you are doing here! You can't find f from its derivative because an infinite number of different functions have the same derivative. If you are also assuming that f(0)= 0, please say that.

But even then, you seem to be saying that [itex]\int_0^q x^n dx+ f'(0)- 1[/itex] will approximate n. For what n? How do you determine what n to use?

If f'(x)= cos(x), and f(0)= 0, then f(x) is -sin(x). I don't see how you can argue that [itex]\int_0^q x^n dx[/itex] will approximate -sin(x) over any reasonable interval for any n.
 
  • #3
As I said, n is just some constant in that particular equation. And I am saying that equation works, when [tex]f(0)=0[/tex], and indeed you can try it.
Of course you can find f from its derivatives... its called an integral, and I am not searching for the integral, but looking to approximate its value at [tex]q[/tex] that is why
[tex]\int_{a}^{b}f(x)=f(b)-f(a)[/tex]
is useful, becasue when [tex]f(0)=0[/tex]
i can do this
[tex]\int_{0}^{b}f(x)=f(b)-0[/tex]
which gives me the value at [tex]f(b)[/tex] and in turn I can give it q, and find f(q).
ie: try it for the [tex]x^n[/tex] that i mentioned.

[tex]f(q)=\int_{0}^{q}x^n=\frac{q^{n+1}}{n+1}-\frac{0^{n+1}}{n+1}=\frac{q^{n+1}}{n+1}[/tex]
Giving me the value of [tex]f(q)[/tex]
However, I do not know when [tex]f(0)=0[/tex], which is why I am asking about a general formula, since I am trying to do this numerically, (similar to Simpson's rule).

I don't think you finished reading my post, I never said [itex]\int_0^q x^n dx+ f(0)- 1[/itex], I said it works for other equations, under the situations I specifed, please read my post before replying! (I even showed x^3, same as x^n, which does not work - again, please read!)

And indeed, I have discoverd a way to solve the problem using the equations I've given, but if someone knows of a formal or already well proven algorithm (or ideas for one) I would still appreciate it! (My algorithm is a heuristic, i have not proven it :( )
 

What is numerical integration?

Numerical integration is a method used in mathematics and science to approximate the value of an integral (area under a curve) using numerical techniques rather than exact analytical methods. It is commonly used when the integral cannot be solved analytically or when the function is too complex to integrate by hand.

What are the different methods of numerical integration?

Some common methods of numerical integration include the trapezoidal rule, Simpson's rule, and Gaussian quadrature. These methods use different techniques to approximate the value of an integral, and their accuracy depends on the complexity of the function being integrated.

How accurate is numerical integration?

The accuracy of numerical integration depends on the method used and the complexity of the function. Some methods, such as Gaussian quadrature, can provide very accurate results, while others may have larger errors. The accuracy can also be improved by using smaller intervals and increasing the number of data points used in the calculation.

What are the advantages of numerical integration?

Numerical integration allows for the approximation of integrals that cannot be solved analytically. It is also useful for dealing with complex functions and can provide results with a high degree of accuracy. Additionally, numerical integration is relatively easy to implement and can be automated, making it a valuable tool for scientists and engineers.

What are the limitations of numerical integration?

One limitation of numerical integration is that it can be time-consuming and computationally intensive, especially for complex functions or large intervals. Additionally, the accuracy of the results depends on the chosen method and the number of data points used, so it is important to choose an appropriate method for the specific problem at hand.

Suggested for: How can I numerically solve for f(q) using only its derivative, f'(x)?

Replies
4
Views
1K
Replies
3
Views
1K
Replies
4
Views
623
Replies
15
Views
1K
Replies
2
Views
197
Replies
31
Views
581
Replies
3
Views
2K
Back
Top