01-15-2018, 12:37 AM

Is there a way to have an integral in the solve application? How, for example, would I ask for integral x dx from 0 to x to equal 3 (the answer is ~2.45)?

You're currently viewing a stripped down version of our content. View the full version with proper formatting.

01-15-2018, 12:37 AM

Is there a way to have an integral in the solve application? How, for example, would I ask for integral x dx from 0 to x to equal 3 (the answer is ~2.45)?

01-15-2018, 12:50 AM

Did a search...asked a similar question ~3 years ago. I'll resubmit if I have a difficulty with the answer on that thread...

01-15-2018, 01:47 AM

They'll nest fine so long as there are enough program steps available for the temporary storage required. Remember that the integral routine is only an approximation and can be slow.

Pauli

Pauli

01-15-2018, 09:40 AM

(01-15-2018 12:37 AM)lrdheat Wrote: [ -> ]Is there a way to have an integral in the solve application? How, for example, would I ask for integral x dx from 0 to x to equal 3 (the answer is ~2.45)?

Sure. You can solve an integral and vice versa. Here's an example.

1. Define the function you want to integrate. Let's say this is ln(2+x).

LBL 01

2

+

LN

RTN

In your special case y=x this simply is

LBL 01

RTN

so that x itself is returned as the function value.

2. Define the function you want to solve. Here the integral from 0 to x is supposed to be 3. So this integral minus 3 equals zero (solve returns the zeros of a function).

LBL 02

0

x<>y

∫ 01

3

–

ROUND

RTN

This places 0 in Y and the (unknown) upper limit in X, calculates the integral and subtracts 3 from the result. Since the integral's accuracy depends on the display setting, the result is rounded. This way the calculation exits if e.g. in FIX 3 the integral is close enough to 3, say 3,0002 or 2,9999. This makes sure that the iteration doesn't get caught in an infinite loop and it also avoids unneccessarily long computation times.

So first of all, be sure to set a reasonable display mode

FIX 4

and try some guesses for the upper limit.

Assuming the ln function:

1 XEQ 02 => –2,0905

2 XEQ 02 => –0,8411

3 XEQ 02 => 0,6609

So the solution is between 2 and 3.

Or with your y=x function:

1 XEQ 02 => –2,5000

2 XEQ 02 => –1,5000

3 XEQ 02 => 1,5000

So for your function the upper limit also is between 2 and 3.

3. Now you can start Solve with these two guesses:

For the ln function:

2 ENTER 3

SLV 02 => 2,5780

For your y=x function:

2 ENTER 3

SLV 02 => 2,4495

Just to be sure, check the integral:

For the ln function:

0 ENTER 2,5780

∫ 01 => ∫≈3,0000

For your y=x function:

0 ENTER 2,4495

∫ 01 => ∫≈3,0000

That's it.

Dieter

01-15-2018, 03:47 PM

Excellent!

**HP Forums:**https://www.hpmuseum.org/forum/index.php**:**

Powered By MyBB, © 2002-2024 MyBB Group