This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Numerator of a rational expression

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.




numer(f) returns the numerator of the expression f.

numer regards the input as a rational expression: non-rational subexpressions such as sin(x), x^(1/2) etc. are internally replaced by "temporary variables". The numerator of this rationalized expression is computed, the temporary variables are finally replaced by the original subexpressions.

    Note:   Numerator and denominator are not necessarily cancelled: the numerator returned by numer may have a non-trivial gcd with the denominator returned by denom. Preprocess the expression by normal to enforce cancellation of common factors. Cf. Example 2.


Example 1

We compute the numerators of some expressions:


numer(x + 1/(2/3*x -2/x))

numer((cos(x)^2 -1)/(cos(x) -1))

Example 2

numer performs no cancellations if the rational expression is of the form "numerator/denominator":

r := (x^2 - 1)/(x^3 - x^2 + x - 1): numer(r)

This numerator has a common factor with the denominator of r; normal enforces cancellation of common factors:


However, automatic normalization occurs if the input expression is a sum:

numer(r + x/(x + 1) + 1/(x + 1) - 1)

delete r:



An arithmetical expression

Return Values

Arithmetical expression.

Overloaded By


See Also

MuPAD Functions

Was this topic helpful?