Re: Exponent function question
- To: mathgroup at smc.vnet.net
- Subject: [mg94391] Re: Exponent function question
- From: dh <dh at metrohm.com>
- Date: Thu, 11 Dec 2008 07:28:05 -0500 (EST)
- References: <ghqju2$138$1@smc.vnet.net>
Hi, what you need is "pattern matching". Try e.g.: Max @ Cases[Sqrt[x^2 + 1], x^n_ :> n, Infinity] hope this helps, Daniel Tuesday Shopping wrote: > Reposting the question (previous post did not make it for some reason) > > Consider a simple example: "Exponent[Sqrt[x^2+1], x]". This gives "0" as output. > > I am trying to determine the maximum exponent of a given variable in an expression. Is there any way to do this? I would like to get "2" as output for the above example. > > Note that the input expression could be quite complex involving many functions, such as trigonametric, logarithms and other functions. However, the exponent itself (2 in the above example) is always going to be an integer. > > Thanks > > > > > >