# Numerical Integration Using JavaScript

Ciprian on Tuesday, May 17, 2022 in Methods, Events and Scopes

This is a quick reminder on how to use mathematical functions inside JavaScript.

Instructions

• Use `*` to indicate multiplication: Type `4*x` for 4x;
• Use `^` to indicate powers: Type `4*x^3` for 4×3 and `12*x^-6` for 12x?6.
• Use parentheses to delimit the argument of a function; i.e., type `sin(x)` rather than `sin x`.
• Use parentheses to define the scope of an operation: For example, type `4*x*(x^2+1)^3` for 4x(x2+1)3 or `4^(2*x+1)` for 42x+1 or `(sin(x))^2` for (sin(x))2.
• Do not type sin^2(x) for sin2(x), type `(sin(x))^2` instead.
• Do not use brackets [ ] or braces { }, use only parentheses to delimit a mathematics expression.
• Functions you may use:

Trig: `sin`, `cos`, `tan`, `cot`, `sec`, `csc`;

Inverse Trig: `asin`, `acos`, `atan`;

Log/exponential: ln (natural log), or use `log`; exp, the natural exponential; Note: You can also enter the natural exponential exp(x) as `e^x` for ex.

Misc: `sqrt`, usage `sqrt(x)` for ?x (or, use exponential notation: `x^(1/2)`).