Monday, January 2, 2012

Setting up Equations for Integration/Solve - HP 15C

Setting up equations for the integration and solve functions for the HP 15C. Since the release of the HP 15C Limited Edition, the processing speed has increased.

The most important thing to remember is that the equation starts with "x" on the x-register of the stack.

With integration, "x" is the variable to be integrated.

With the solve function, "x" is the variable to be solved for.

Depending on the equation, in general, you will need to duplicate "x" with [ENTER] as many times as "x" appears in the equation. Algebraic manipulation of the equation can be helpful. A technique known as Horner's Method can be used for polynomials. It also helps to handle the innermost expressions first, working outside.

I often straw a stack diagram:

ST X, ST Y, ST Z, ST T

Several things to remember:

Most two-argument functions (arithmetic, power, combination, permutation, etc):

ST T retains what was in ST T
ST Z copies the contents of ST T
ST Y the contents of ST Z moves here
ST X result of the function

Pressing ENTER, recalling from a memory register, or entering π

ST T the contents of ST Z moves here
ST Z the contents of ST Y moves here
ST Y the contents of ST X moves here
ST X the number just entered or recalled


Horner's Method

Let the polynomial p(x) = a_n * x^n + a_n-1 * x^(n-1) + ... + a1 * x + a0

Applying Horner's Method to p(x):

( ... (a_n * x + a_n-1) * x + a_n-2) * x + a_n-3) ... + a1 ) * x + a0

Functions

Integration: [ f ] [ x ] label

Solve: [ f ] [ ÷ ] label


This blog provides examples of integration, but ideas can be taken from the examples for use in solving equations.


Examples are in the format of:

b
∫ f(x) dx
a

All results shown here are rounded to 4 decimal places (FIX 4).

Example 1:

5
∫ x^2 * cos x dx
1




KEY ST X ST Y ST Z ST T
LBL 1 x - - -
ENTER x x - -
COS cos(x) x - -
x<>y x cos(x) - -
x^2 x^2 cos(x) - -
× f(x) - - -


Result: -19.4578


Example 2:

π
∫ x sin((π * x)/4) dx
0



KEY ST X ST Y ST Z ST T
LBL 2 x - - -
ENTER x x - -
π π x x -
× π*x x - -
4 4 π*x x -
÷ (π*x)/4 x - -
SIN sin(π*x/4) x - -
× f(x) - - -
RTN


Result: 4.1369


Example 3

3.5
∫ x / (x^2 + 3x - 4 ) dx =
3

3.5
∫ x / ((x + 3) *x - 4) dx
3



KEY ST X ST Y ST Z ST T
LBL 5 x - - -
ENTER x x - -
ENTER x x x -
3 3 x x x
+ x+3 x x x
× x(x+3) x x x
4 4 x(x+3) x x
- x(x+3)-4 x x x
1/x 1/... x x x
× f(x) x x x
RTN


Result: 0.0998


Example 4:

3
∫ √(x^3 - 2x + 1)/x dx
1



Let ø = √(x^3 -2x+1)


KEY ST X ST Y ST Z ST T
LBL 3 x - - -
ENTER x x - -
ENTER x x x -
3 3 x x x
y^x x^3 x x x
x<>y x x^3 x x
2 2 x x^3 x
× 2x x^3 x x
- x^3-2x x x x
1 1 x^3-2x x x
+ x^3-2x+1 x x x
√ ø x x x
x<>y x ø x x
÷ f(x) x x x
RTN


Result: 2.0912

Here are a few more examples of integrals. Try and draw the stack diagram for each step.

Example 5:

8.5
∫ x * √(x^2 - 3*x - 4) dx =
4.5

8.5
∫ x * √((x - 3) * x - 4) dx
4.5



LBL 6
ENTER
ENTER
3
-
×
4
-

×
RTN


Result: 117.2455

Example 6:
π/4
∫ x * (( sin(x-2) )/(cos x)) dx
0



LBL 7
ENTER
ENTER
2
-
SIN
x<>y
COS
÷
×
RTN


Result: -0.3578


I hope you find this blog helpful. Until next time, Eddie



This blog is property of Edward Shore. © 2012

1 comment:

  1. I would be glad to include some of your programs in the next release of my HP-15C simulator (http://www.hp-15c.homepage.t-online.de).
    Can you contact me?

    Torsten

    ReplyDelete

Adventures in Python: String Manipulation and Function/Derivative Table (Subroutines)

Adventures in Python:  String Manipulation and Function/Derivative Table (Subroutines) String Manipulation This script demonstrate...