## Introduction, Help

User-defined functions can be defined then used in various HP Prime applications or during Home or CAS operations.  As usual, you can check out the online help before using this feature.  In the examples below, we will also use the Function App to plot the user defined functions.

## Example 1 - define a polynomial then plot in Function App

Say  you wanted to define and plot an expression AX2 + BX + C where the coefficients A,B and C can be adjusted by you as needed.   The following will define a new expression:

 Shift  Define   ALPHA   ALPHA[1]  polynom_ABC  EnterALPHA  X  x2  ×  ALPHA  A  +  ALPHA  B  ×  ALPHA  X  +  ALPHA  C  Enter  Then check all the variable boxes - if not already checked  OK.

There is now a new expression polynom_ABC saved in Toolbox/User/User Functions.  Note the order of the variables (X,A, B, C).  This is important when using this definition later.

Now, open the Function App, Symb  view.  In the top function F1(X)= insert the new polynom_ABC function.  Key in the coefficient values for (X,A, B, C) using X, 1, -1 and 1.  Finally, you can use copy/paste to enter this function in F2(x) through F6(x).

 Symb   Toolbox  User Functions  polynom_ABC X  ,  1  ,  1  +/-  ,  1   OKClick on F1(x) inputbox Shift Copy Click on F2(x) inputbox Shift Paste 1   OK

Your Function App Symb screen should look similar to below.   You can use your own values for A, B and C if you wish.

To plot these values, press the Plot key.  The curves shown below are F1-F6.   If you want to see how other A,B,C coefficients affect curve(s), simply return to the Symb view and edit the coefficients.

Try the following on your own:

• Create a User function F_x = COS(X)/expx/2
• Plot this using Function App
• Edit F_x  and add a coefficient or two to the equation
• Shift   Define Choose
• In Function App, you may need to edit F_x(X,coeff…)

[1]  Depending on whether you started in Home or CAS mode, you may need to use Shift  to enter lower case characters.  I used lower and uppercase, but either will work.  Keying this in on the emulator is easier.