I'm writing a program where I need to input for a function. I can change the function in the code itself, but I want to input for it when I run the program. Is there a simple way to ask the user for a function?

I needed to do this for a quadratic formula, and It is relatively simple.

```
ClrHome //for a blank screen
prompt A,B,C //This can be input, and put in the variables for the numbers here
//put in the formula step by step here
//end of formula
Disp //ending result
```

use the variables for the numbers and work the function step by step until solved

hope this helped!

I think I was misunderstood. Say one time I run a program I want to input the function X^{2} + 3X + 2, and the next time I run said program, I want to input X^{3} - 4X^{2} + 8X - 5. I have already created a program for the Quadratic Formula. I am now working on a program that involves taking the derivative of a function multiple times (deriv( of function A becomes function B, take deriv( of B, etc.). As I said I can edit the program to put the equation into the code, but that is kind of cumbersome. I've tried using strings, but my calculator won't let me take the derivative of those. When I use Input, if I were to input X^{2} + X, the calculator uses the value already stored to X to calculate the function, and then stores that value to the variable. So, how do I have the calculator ask for a function that it will not compute, but can still take the derivative (or do something else) with it?

I have two methods, both start by storing to a string. The first method then has you store to an equation variable like Y1 or *u*. You can use these directly. Please look into how you can use these vars as they can be really, really useful.

The second method is like the first, without using an equation variable. It's a bit more cumbersome, but you can use expr(

Z80 Assembly>English>TI-BASIC>Python>French>C>0

Thank you! Now I can get somewhere with my program.

One last question: how might I take the 2nd, 3rd, and 4th derivatives of a function? From what I read on the nDeriv( page, it doesn't sound like I can do it with the nDeriv( function. Is there another way I can do it?

One way is to just numerically compute it. Do you know the limit definition of the derivative?

Z80 Assembly>English>TI-BASIC>Python>French>C>0

something like f(X+H)-f(X-H) all divided by 2H. I have multiple versions of it written down in a notebook.

Yup! For n-th derivatives, you might be able to make it recursive. For example, $$ f''(x)=\lim_{h\rightarrow 0}{\frac{f'(x+h)-f'(x-h)}{2h}} $$.

Sorry, on mobile so it's a pain to type math.

Z80 Assembly>English>TI-BASIC>Python>French>C>0

I've made some serious progress by using the limit definition of the derivative, but in order to make it work I have to use a lot of strings. I'm using 1 string for each term (with a max of 5 terms), a string each for (X+H) & (X-H), a string to replace X while inputting the terms, and a string for each half of the numerator (A-B). That is 10 strings, so for each added derivative I will have to reuse strings. My problem is that when I get the formula down to (Str8-Str9)/2H→Str1 (reuse of Str1), the calculator gives me an error message during execution, "Attempted to store a matrix to a list." How might I fix that?

I would use that, but there are no matrices or lists in my program. My calculator gives me that error description all the time for seemingly no reason.

No, I haven't tried that. I once had an issue with the calculator where I lost all my programs because the RAM reset. I probably should backup my programs, but most of them aren't very long and don't require much effort to rewrite. I'll probably do that when I'm not so busy.