Tampilkan postingan dengan label integration. Tampilkan semua postingan
Tampilkan postingan dengan label integration. Tampilkan semua postingan

Casio fx-9750GIII: Integrals with Infinite Limits

Casio fx-9750GIII:  Integrals with Infinite Limits





A Substitution to Get to Infinity... 


It is quite a challenge to calculate numerical integrals with infinite limits such as 


∫( f(x) dx, a, ∞)


∫( f(x) dx, -∞, a)


∫( f(x) dx, -∞, ∞)



A trick is to substitute x = tan Θ.  Then:


Θ = arctan x


dx = sec^2 Θ dΘ = cos^-2 Θ dΘ



Note that


lim t→∞ arctan t = π/2


lim t→-∞ arctan t = -π/2  


In this blog, assume that radian angle mode is used in all calculations.


Let's go over some examples and see how it works.  I used a Casio fx-9750GIII, however, this technique should work with all calculators with numerical integral calculations.  Furthermore, changing the integral will allow for Simpson's Rule or Trapezoid Rule approximation.


For the upper limit, I approximate π/2.


A = 1.5708  (π/2 to 4 places)

B = 1.570796  (π/2 to 6 places)

C = 1.57079633 (π/2 to 8 places)



Example 1:  


∫( e^(-x^2) dx, 0, ∞)  


transforms to


∫( e^(-tan^2 Θ)/cos^2 Θ dΘ, 0, ≈π/2)


Calculations (fx-9750GIII):


Upper Limit: A (see above),  Result:  0.8862269255


Upper Limit: B,  Result:  0.8862269255


Upper Limit: C,  Result:  0.8862269255




Example 2:  


∫(x^0.5 * e^(-x) dx, 0, ∞)


transforms to


∫((tan Θ)^0.5 * e^(-tan Θ))/cos^2 Θ dΘ, 0, π/2)


Calculations:


Upper limits A, B, C:  0.862269255


Coincidently, ∫( e^(-x^2) dx, 0, ∞)  = ∫(x^0.5 * e^(-x) dx, 0, ∞) = Γ(1.5) = √(π)/2




Example 3:


∫( e^x*(x^2 + 1) dx, -∞, 0)


transforms to


∫( e^(tan Θ) * (tan^2 Θ + 1)/cos^2 Θ dΘ, -π/2, 0)

=  ∫( e^(tan Θ) * 1/cos^2 Θ * 1/cos^2 Θ dΘ, -π/2, 0)

∫( e^(tan Θ)/cos^4 Θ dΘ, -π/2, 0)


For upper limits A, B, C, the answer returned is 3, which is the exact answer.  


For integrals like this all is needed is a four digit approximation of π/2 = 1.5708.



Let's keep going:


Example 4:


∫( (x^2 + 1)/(x^4 - 1) dx, 0, ∞) 


transforms to


∫( 1/cos^Θ * (tan^2 Θ + 1)/(tan^4 Θ - 1) dΘ, 0, π/2)

= ∫( 1/(sin^4 Θ - cos^4 Θ) dΘ, 0, π/2)


On the fx-9750GIII get MA Error.  



Example 5:


∫( 1/√(x^2 + 3*x + 1) dx, 0, ∞)


transforms to 


∫( 1/(cos^2 Θ * √(tan^2 Θ + 3 * tan Θ + 1)) dΘ, 0, π/2)


like example 4, I get the MA Error.



Observation:  the transformation works best if the integral involves some form of either of the following:


f(x) * e^(g(x))


or 


f(x) * e^(-g(x))



Gamma


The Gamma Function is an excellent candidate for this transformation.  


Γ(t) = ∫( x^(t-1) * e^-x dx, 0, ∞)


transforms to


∫( tan^(t-1) Θ * e^(-tan Θ)/cos^2 Θ dΘ, 0, π/2)



Source


Mier-Jedrzejuwicz, W.A.C. Ph.D.    Tips And Programs for the HP 32S   Synthetix Publication.  Berkeley, CA.  September 1988.  ISBN 0-937637-05-X


Download the book here:  https://literature.hpcalc.org/items/1756




Happy calculating,


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. 


Calculus: Scaled Integration

Calculus:  Scaled Integration


Introduction


The take the integral:


∫( f(x) dx, A, B) 


The integral can be transformed to new limits C and D via linear transformation:



∫( f(x) dx, A, B) → ∫( g(y) dy, C, D)


Where the interval [ C, D ] has the smaller range than [ A, B ].


Set the transformation to:


y = m*x + β


C = m*A + β

D = m*B + β


Solving for m, β:


(C - D) = (A - B) * m

m = (C - D) / (A - B)


and


β = C - A * m = D - B * m


Solving y = m*x + β for x:


x = 1/m * (y - β)


Taking the derivative of both sides:


dx = 1/m  dy


The transformed integral:


∫( f(x) dx, A, B) → 1/m * ∫( f(1/m * (y - β)) dy, C, D)


Examples


Example 1:  


∫(x^2 - 5 dx, 10 ,16) but scale the integration interval to [1, 2].


A = 10, B = 16, C = 1, D = 2

m = (1 - 2)/(10 - 16) = 1/6,  1/m = 6

β = 1 - 10 * 1/6 = -2/3

x = 6 * (y + 2/3) = 6 * y + 4


Transformed Integral:

6 * ∫( (6*y + 4)^2 - 5 dy, 1, 2) = 1008


Example 2:


∫( e^x * ln(x + 2) dx, 0, 5) but scale the integration to [0, 1].


A = 0, B = 5, C = 0, D = 1

m = -1/-5 = 1/5,  1/m = 5

β = 0 - 0 * 1/5 = 0

x = 5 * y


Transformed Integral:

5 * ∫( e^(5 * y) * ln(5 * y + 2) dy, 0, 1) ≈ 262.8586594


Numerical integrals were calculated with the TI-36X Pro.  


When trying the Simpson's rule or Trapezoid rule, I find the smaller range does not really give better estimates.  But I am presenting the technique and if this helps in the future, great.  


Coming up:


July 11 - July 15, 2022:  TI-58 and TI-59 Week

Next Regular Blog:  July 23, 2022


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. 


Retro Review: Hewlett Packard HP 33S

Retro Review:   Hewlett Packard HP 33S








The calculator with the Chevron Keyboard!

Quick Facts

Model:  HP 33S
Company:  Hewlett Packard
Years:  2003-2007
Type:  Scientific
Batteries: 2 x CR-2032
Operating Modes:  RPN, ALG
Memory:  31,277 bytes
Number of Registers: 27, A-Z, i
Display:  2 stack levels

Features

*  standard scientific calculator functions: trig, logs, power, absolute value, integer and fractional part, combinations, permutations, random numbers, hyperbolic functions, and more
*  factorial function that allows real numbers;  Γ(x) = (x - 1)!
*  polar and rectangular conversion functions,  very popular (for good reason) 
*  40 scientific constants
*  8 sets of SI-US conversions
*  base conversions 
*  algebraic mode (which I don't know anyone who would use this calculator in algebraic mode, but it's there)
*  linear regression  (y = mx + b)
*  fraction display mode ( [ ←| ] [ . ] (FDISP))
*  storage and recall arithmetic

We can store equations for evaluation, solving, and integration.  

Full list of conversions:

Polar (→θ,r) - Rectangular (→y,x)
Hours (→HR) - Hours-Minutes-Seconds (→HMS)
Degrees - Radians
Kilograms - Pounds
Degrees Celsius - Degrees Fahrenheit
Centimeters - Inches
Liters - Gallons

Programming

The HP 33S has keystroke programming and the set of commands similar from the HP 32SII:  

*  INPUT var
*  VIEW var  (views the variable without putting the variable's value on the stack)
*  Subroutines and Return
*  Comparison tests between x and 0, x and y.  If the test is true, execute the next step, otherwise skip the next step
*  ISG:  Increment and skip if greater
*  DSE:  Decrement and skip if equal or less than

The HP 33S designates one register, lower case i, for indirect addressing.  The absolute integer value of i determines where storage, recall, label, subroutine, integration variable, exchange, and function designation.  Use (i) to use indirect addressing.  Indirect registers can also access statistical sums:

(i) = 27,  i 
(i) = 28,  n
(i) = 29,  Σx
(i) = 30,  Σy
(i) = 31,  Σx^2
(i) = 32,  Σy^2
(i) = 33,  Σxy

The HP 33S has 26 labels, which restrict programs to 26.  Hence, LBL A instead of LBL A0001.   At first, I didn't like the restriction, but I learned to live with it and don't mind it as much.  

Let's Talk About the Chevron Keyboard

The HP 33S is a unique calculator it's keyboard style:  the keys take a slanted quadrilateral shape, with the center column of keys taking a chevron style shape.   At the top there is a directional pad.  Hewlett Packard took a chance with the design from the standard calculator shape, and it was not a homerun.   

The beginning production of the HP 33S was not successful. Keys had bad responses, the display was not up to par, and some keys are hard to press.   It took Hewlett Packard several production runs to get the keyboard working right, which unfortunately killed the reputation of the HP 33S.  Towards the end of its run, the keyboards were fixed.

I don't mind the unique keyboard, my biggest issue was the spacing the keys where sometimes the shifted functions and alpha characters did not have much space.  This made the keyboard busy.  I also do not like the black arrows on the green and purple backgrounds on the shift keys, I use HP used a lighter font for those arrows.  

A Phoenix of Calculators  

When the HP 33S first hit the market, the calculator was disliked.  Now, it is a sought after calculator.   The original price for the 33S was about $50 US dollars, now if you want one, be prepared to pay at least $75 US dollars, sometimes triple digits.  Make sure you are buying the HP 33S from later in the run (towards 2007).  

Another factor of why the HP 33S is becoming a collector's calculator, the successor, the HP 35S, had several shortcomings such as the number of mathematical bugs and the lack of the rectangular and polar conversion functions.   The HP 33S is closer to the classic style, like the HP 32S and HP 32SII.  

I don't expect to ever be an anniversary edition of the HP 33S but it was an underrated calculator and has its place in calculator history.

Tomorrow I have a list of programs and an integer demonstration.  

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. 



Retro Review: Texas Instruments TI-65

Retro Review:   Texas Instruments TI-65







Quick Facts:


Model:  TI-65 Technical Analyst 

Company:  Texas Instruments

Years:  1986-1989

Type:  Scientific, Programming

Batteries: 2 x LR44

Operating Mode:  AOS

Memory Registers:  up to 16 (0-F)

Programming Steps:  up to 100

Comes in case

Stopwatch and Timer Included



Features


The TI-65 is a late entry of the Texas Instruments and has the following features:


*  Trigonometry, Logarithms, Powers

*  Absolute value, integral and fraction part

*   DMS and HMS conversions  (degrees and hours, respectively, 360° for degrees, 24 hours)

*  Eight scientific constants

*  Eight conversions  (→ (US to SI),  INV for ← (SI to US), except Joules/calories which the order is reversed)

*  Base conversions to hexadecimal and octal only (unfortunately not binary nor any Boolean algebra)

*  Statistics

*  Linear Regression

*  Storage Arithmetic 

*  Numeric Integration

*  Programming


Scientific Constants (the values stored in the TI-65):

c:  Speed of light = 299792458 m/s

g:  Earth's gravity = 9.80665 m/s^2

me: Mass of an electron = 9.109534 * 10^-31 kg

e:  Charge of an electron = 1.6021892 * 10^-19 C

h:  Plank's Constant = 6.626176 * 10^-34 J s

k:  Boltzmann's Constant = 1.308662 * 10^-23 J/K

Na:  Avogadro's Constant = 6.022045 * 10^23 molecules/mole

R:  Gas Constant = 8.31441 J/(mole * K)


The SI units are printed with the constants on the TI-65, which I like.  


Conversions:

inches - centimeters

ounces - gallons

gallons - liters

degrees Fahrenheit - degrees Celsius

pounds per inch - Pascals

horsepower - kilowatts

Joules - calories

pounds (* foot) - Newtons


Programming, Integration, and Memory


The TI-65 has 100 programming steps that is shared with the memory register.   A register is worth seven programming steps, and the amount of memory registers available decrease as you type in steps.   Most programming steps are fully merged, hence 2nd, 3rd, and INV (indicated by a negative sign in the key code) with its key count as one step.  However, storage arithmetic takes two steps.



Maximum Number of Memory Registers vs. Maximum Amount of Steps


100 steps:  1 register (R0)

98 steps:  2 registers (R0, R1)

91 steps:  3 registers (R0, R1, R2)

84 steps:  4 registers (R0 to R3)

77 steps:  5 registers (R0 to R4)


In learn mode, the number of steps and the maximum number of registers are on display, along with the programming step.  


Memory registers can be protected by the [ 2nd ] (PUM) # sequence.  


A full set of programming commands are here:


DSZ:  decrement R# and skip if zero

INV DSZ:  decrement R# and skip if not zero

x<m:  test x < R#

INV x<m:  test x ≥ R#

x=m:  test x = R#

INV x=m:  test x ≠ R#

x>m:  test x > R#

INV x>m:  test x ≤ R#

LBL and GTO:  label (0-9, A-F, F1, F2)

F1 and F2:  user keys and labels

PAUSE:  pauses execution

SBR:  subroutine

INV SBR:  return

LIST:  display steps stored in memory


Integration:  Integration requires R0, R1, and R2 to be protected by PUM 2.  In the program, use R1 for x (you are given x in the register to start), end the function with [ = ] [ R/S ].    Calculation:  lower [ STO ] 1, upper [ STO ] 2, [ 2nd ] ( ∫dx) n [ R/S ]


Statistics:  Clear all protection first by PUM 0.   Six registers are used, and a maximum number of programming steps is 63 while statistical data is stored.  From the TI-65 manual, the following registers take the following values:


R1 = n * Σxy - Σx * Σy

R2 = n

R3 = Σy

R4 = n * Σy^2 - (Σy)^2

R5 = Σx

R6 = n * Σx^2 - (Σx)^2


Stopwatch and Timer


The TI-65, billed as a technical calculator aimed at professionals, includes a stopwatch and timer (but not a clock).  


Stopwatch:  

Press [ 3rd ] ( TUp↑) to start the stop watch.  Do this again to stop it.  


Timer:

Enter the time in hh:mm:ss  (hours:minutes:seconds) format, press [ 2nd ] ( TDn↓ ) to start the timer.   Do this again to stop it.   There are no sounds, the timer displays 00:00:00 when completed.  


You can store the timer into any available register. The store key is not required in this instance.   Recall the last time by pressing [ RCL ] [ : ].   


It may be possible to include the stopwatch and timer, however, they will not run in the background.   When the stopwatch or timer is working, the TI-65 is locked out of calculations.  Still, a nice feature.  





Closing Thoughts


I believe that the TI-65 is the penultimate calculator in the Galaxy series (the last is the TI Galaxy 67).  It's one of Texas  Instruments' most underrated calculators and production had continued into the 1990s, it could of had served as a non-graphing alternate to the TI-81.   Back in the early 1990s, graphing calculators were not as accepted in school; today, they are expected.


If you are collecting calculators, I would recommend the TI-65.  It's one of the best keystroke programming calculators Texas Instruments made since the TI 58/59, with a complete set of instructions and a decent amount of memory.  You do need a little patience because the TI-65 can be slow (especially compared to today's calculators).  The case and the sticker with helpful hints attached to it make a nice touch.  


(I don't recall the TI-67 Galaxy ever being on sale in the United States.)


Here are some TI-65 programs I posted in July 2016:

http://edspi31415.blogspot.com/2016/07/ti-65-programs-part-i-digital-root.html


http://edspi31415.blogspot.com/2016/07/ti-65-programs-part-ii-reynolds.html


http://edspi31415.blogspot.com/2016/07/ti-65-programs-part-iii-impedance-and.html


and will have more on tomorrow's post.



Sources:


Texas Instruments.  "TI-65 Technical Analyst" http://www.datamath.net/Leaflets/CL-947A_US.pdf     Flyer provided by datamath.net.  Last accessed April 10, 2022.


Texas Instruments TI-65 Technical Analyst Guidebook  1986


Toth, Viktor.  "TI-65"   rskey.org. 2022  http://www.rskey.org/ti65  Last Accessed April 29, 2022


Tschnenrechner-Sammlung, Tony   "TI-65 Galaxy"  Tony's Taschenrechner-Sammlung Calculator Collection https://www.thimet.de/CalcCollection/Calculators/TI-65/Contents.htm  Last accessed April 29, 2022



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. 


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. 


March Calculus Madness Sweet Sixteen - Day 16: A Parametric Integral Example

 ------------


Welcome to March Calculus Madness!


------------


Let:

x(t) = a * cos t

y(t) = b * sin t


Then:

∫ y(x) dx = ∫ y(t) * x'(t) dt


x'(t) = -a * sin t


And:

∫ y(t) * x'(t) dt

= ∫ -a * sin t * b * sin t dt

= -a * b * ∫ sin^2 t dt

= -a * b * ∫1/2 - 1/2 * cos(2*t) dt

= -a * b * (t/2 - sin(2*t)/4) + C


That wraps up March Calculus Madness 2022.  


Next Post:  April 9, 2022


Have a great day and hope you enjoyed the series!  


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. 


March Calculus Madness Sweet Sixteen - Day 15: r = α * (1 - cos Θ)

 ------------


Welcome to March Calculus Madness!


------------


r = α * (1 - cos Θ)


r = α * (1 - cos Θ)

r^2 = α^2 * (1 - 2 * cos Θ + cos^2 Θ)


dr/dΘ = α * sin Θ

(dr/dΘ)^2 = α^2 * sin^2 Θ



Area from 0 ≤ Θ ≤ 2*π


1/2 * ∫ α^2 * (1 - cos Θ)^2  dΘ from Θ = 0 to Θ = 2*π

= α^2/2 * ∫ 1 - 2 * cos Θ + cos^2 Θ dΘ from Θ = 0 to Θ = 2*π

= α^2/2 * ∫ 1 - 2 * cos Θ + 1/2 * cos(2*Θ) + 1/2 dΘ from Θ = 0 to Θ = 2*π

= α^2/2 * (3/2 * Θ - 2 * sin Θ + 1/4 * sin(2*Θ) from Θ = 0 to Θ = 2*π)

= 3/2 * π * α^2


Arc Length from 0 ≤ Θ ≤ 2*π


r^2 + (dr/dΘ)^2

= α^2 * (1 - 2 * cos Θ + cos^2 Θ) + α^2 * sin^2 Θ

= α^2 - 2  * α^2 * cos Θ + α^2 * (cos^2 Θ + sin^2 Θ)

= α^2 - 2  * α^2 * cos Θ + α^2 

= 2 * α^2 - 2 * α^2 * cos Θ

= 2 * α^2 *(1  - cos Θ)


Arc Length:

∫ 2 * α^2 *(1  - cos Θ) dΘ from Θ = 0 to Θ = 2*π

= α * √2 * ∫ √(1  cos Θ) dΘ from Θ = 0 to Θ = 2*π

= α * √2 * 4 * √2

= 8 * α


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. 


March Calculus Madness Sweet Sixteen - Day 14: The Arc Length of a Spiral

 ------------


Welcome to March Calculus Madness!


------------


The Length of a Spiral from 0 ≤ Θ ≤ m


The equation of a spiral:  r = α * Θ


The arc length of a polar equation r(Θ):  ∫ √(r(Θ)^2 + (dr/dΘ)^2) dΘ


r = α * Θ

r^2 = α^2 * Θ^2


dr = α dΘ

(dr/dΘ)^2 = α^2


∫ √(α^2 * Θ^2 + α^2) dΘ from Θ = 0 to Θ = m

= α * ∫ √(Θ^2 + 1) dΘ from Θ = 0 to Θ = m

= α/2 * ( ln|Θ + √(1 + Θ^2)| + Θ * √(1 + Θ^2) for Θ = 0 to Θ = m)

(see below)

= α/2 * ( ln|m + √(1 + m^2)| + m * √(1 + m^2) )



Aside:

∫ √(1 + Θ^2) dΘ


Let Θ = tan x

dΘ = sec^2 x dx


∫ √(1 + Θ^2) dΘ

= ∫ √(1 + tan^2 x) * sec^2 x  dx

= ∫ √(sec^2 x) * sec^2 x dx

= ∫ sec^3 x dx

= 1/2 * ∫ sec x dx + (sec x * tan x)/2 + C

(per reduction integration rule for sec x)


= 1/2 * ln|tan x + sec x| + 1/2 * sec x * tan x + C


with: 

Θ = tan x

arctan Θ = x

sec(arctan Θ) = sec x

√(1 + x^2) = sec x


= 1/2 * ln|Θ + √(1 + Θ^2)| + 1/2 * Θ * √(1 + Θ^2) + C


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. 


Backlink 9999 Traffic Super

Order Now...!!!!