04-03-2020, 12:16 PM
The program INTEGRALSOLVE solves the following integral equation for x:
x
∫ f(X) dX - a = 0
0
using Newton's method.
Big X represents the variable of f(X) to be integrated while small x is the x that needs to be solved for.
Taking the derivative of the above integral using the Second Fundamental Theorem of Calculus:
d/dx [ ∫( f(X) dX from X=0 to X=x ) - a ]
= d/dx [ F(x) - F(0) - a ]
= d/dx [ F(x) ] - d/dx [ F(0) ] - d/dx [ a ]
= d/dx [ F(x) ]
= f(x)
F(X) is the anti-derivative of f(X). F(0) and a are numerical constants, hence the derivative of each evaluates to 0.
Newton's Method to solve for any function g(x) is:
x_n+1 = x_n - g(x_n) / g'(x_n)
Applying this to the equation, Newton's Method gives:
x_n+1 = x_n - [ ∫( f(X) dX from X=0 to X=x_n ) - a ] / f(x_n)
HP Prime Program INTEGRALSOLVE
Note: Enter f(X) as a string and use capital X. This program is designed to be use in Home mode.
EXPORT INTEGRALSOLVE(f,a,x)
Examples
Radians angle mode is set.
Example 1:
Solve for x:
x
∫ sin(X) dX = 0.75
0
Initial guess: 1
Result: x ≈ 1.31811607165
Example 2:
Solve for x:
x
∫ e^(X^2) dX = 0.95
0
Initial guess: 2
Result: x ≈ 0.768032819934
Blog link: http://edspi31415.blogspot.com/2020/04/h...tions.html
x
∫ f(X) dX - a = 0
0
using Newton's method.
Big X represents the variable of f(X) to be integrated while small x is the x that needs to be solved for.
Taking the derivative of the above integral using the Second Fundamental Theorem of Calculus:
d/dx [ ∫( f(X) dX from X=0 to X=x ) - a ]
= d/dx [ F(x) - F(0) - a ]
= d/dx [ F(x) ] - d/dx [ F(0) ] - d/dx [ a ]
= d/dx [ F(x) ]
= f(x)
F(X) is the anti-derivative of f(X). F(0) and a are numerical constants, hence the derivative of each evaluates to 0.
Newton's Method to solve for any function g(x) is:
x_n+1 = x_n - g(x_n) / g'(x_n)
Applying this to the equation, Newton's Method gives:
x_n+1 = x_n - [ ∫( f(X) dX from X=0 to X=x_n ) - a ] / f(x_n)
HP Prime Program INTEGRALSOLVE
Note: Enter f(X) as a string and use capital X. This program is designed to be use in Home mode.
EXPORT INTEGRALSOLVE(f,a,x)
Code:
BEGIN
// f(X) as a string, area, guess
// ∫(f(X) dX,0,x) = a
// EWS 2019-07-26
// uses Function app
LOCAL x1,x2,s,i,w;
F0:=f;
s:=0;
x1:=x;
WHILE s==0 DO
i:=AREA(F0,0,x1)-a;
w:=F0(x1);
x2:=x1-i/w;
IF ABS(x1-x2)<1ᴇ−12 THEN
s:=1;
ELSE
x1:=x2;
END;
END;
RETURN approx(x2);
END;
Examples
Radians angle mode is set.
Example 1:
Solve for x:
x
∫ sin(X) dX = 0.75
0
Initial guess: 1
Result: x ≈ 1.31811607165
Example 2:
Solve for x:
x
∫ e^(X^2) dX = 0.95
0
Initial guess: 2
Result: x ≈ 0.768032819934
Blog link: http://edspi31415.blogspot.com/2020/04/h...tions.html