Hi,
I’m new to Mathematica and recently started to explore on algorithm complexity. Using an example,
Show that f (x) = x² + 2x + 1 is O(x²)
I want to use Mathematica to calculate the constant of the C such that f(x)<=C.g(x) whenever x>k.
Manually, C can be calculated by replacing the degree/power from the leading coefficients to all the coefficients per examples below
Example 1:
C = x² + 2x + 1
= x² + 2x² + x²
= 4x²
Example 2:
C = 6x + 11
= 6x + x
= 7x
Therefore, is there any function that could be used in Mathematica that could help me calculate C from a function? I tried Coefficient and CoefficientList but it doesn’t do what I want. Thanks!
However, the output produced is 17x instead of 7x due to the calculation of the last coefficient (it should convert the last coefficient [11] → x). Is there a way to achieve this?