Example: hasVariables and getVariables
Use the hasVariables function to check if specific variables are used in an expression.
Extract the variables from an expression using the getVariables function.
1. Define an expression.
2. Use getVariables to create a vector of all the variables of expression A.
3. Use hasVariables to determine whether there are variables in the expression.
4. Use hasVariables to determine whether f is a variable in the expression.
5. Use hasVariables to determine whether k is a variable of the expression A.
You can see that f is a variable of the expression, while k is not.