## 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 TLBL 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 TLBL 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 TLBL 5	x	-	-	-ENTER	x	x	-	-ENTER	x	x	x	-3	3	x	x	x+	x+3	x	x	x× 	x(x+3)	 x	x	x4	4	x(x+3)	 x	x-	x(x+3)-4 x	x	x1/x	1/...	x	x	x×	f(x)	x	x	xRTN`

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 TLBL 3		x		-		-		-ENTER		x		x		-		-ENTER		x		x		x		-3		3		x		x		xy^x		x^3		x		x		xx<>y		x		x^3		x		x2		2		x		x^3		x×		2x		x^3		x		x-		x^3-2x		x		x		x1		1		x^3-2x		x		x+		x^3-2x+1	x		x		x√		ø		x		x		xx<>y		x		ø		x		x÷		f(x)		x		x		xRTN`

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 6ENTERENTER3-× 4-√ ×RTN`

Result: 117.2455

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

`LBL 7ENTERENTER2-SINx<>yCOS÷× 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

### Retro Review: Radio Shack EC-2024

Retro Review:  Radio Shack EC-2024 Quick Facts Company:  Radio Shack Years in Production: Around 1994 Original Price: \$24.99 Bat...