Monday, June 6, 2022

Plus42: Integration in Solver

Plus42: Integration in Solver


The Plus42 adds an integral function to the solver engine.


Just a Reminder:  Get the Plus42 App


Author:  Thomas Okken


App: 

Android:  $9.99

iOS:  $9.99

PC/MacOS/Linux:  Free

Donations Accepted


Link:  https://thomasokken.com/plus42/


Plus42 ∫ Syntax


∫(EXPR:VAR:LLIM:ULIM[:ACC])


EXPR:  expression to be integrated


VAR:  variable to be integrated


LLIM: lower limit


ULIM:  upper limit


ACC:  accuracy factor, an optional argument.  If ACC is omitted, then Plus42 uses the highest accuracy factor.   


Let's take a look at some of the integrals that can be used.  In this blog, all results are rounded to four decimal places (FIX 4 is the default setting of Plus42)


Example 1:  Basic Integral


I = ∫(x^2 + 1 dx, x = 0, 3)


Solver syntax:

I=∫(X^2+1:X:1:6)


This integral calculates the numerical integral of x^2 + 1 from x = 1 to x = 6.   In calculation mode, pressing ( I ) twice would definitely get the result.  


Result:  I=76.6667


Example 2:  Variable Upper Limit


I = ∫(x^3/3 - 2 dx, x = 0, A),   A is the upper limit


Solver syntax:

I=∫(X^3÷3-2:X:0:A)


Upper limit known, find the integral:

A = 4;  result:  I = 13.3333


Integral known, find the upper limit:

I = 4;  result:  A = 3.3692 (it may take have time depending on the initial guess)


I like how the solver can find both the value of the integrals and solve for the limits of the integral.


Example 3:  Variable in the Integrand


I = ∫((x^2 * (x - B)) / (B^2 + x^2) dx, x = 0, 1),  B is a variable constant


Solver syntax:

I=∫((X^2×(X-B))÷(B^2+X^2):X:0:1)


B = 1; I = -0.0612

B = 3; I = -0.0784  (I set the initial guess of I = 0)


B can be solved for if you have a good guess and you are willing to wait for the solver to work.


I = -0.07; B = 3.6139


Full Precision:  3.613900797617638382718999085866498


Eddie 


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.