# Can h(x)=(cos x)^x be written as a composition of two functions f and

1. Jul 14, 2010

### PeterPumpkin

Can h(x)=(cos x)^x be written as a composition of two functions f and g where f(x)=x^n and g(x)=cosx ? where h=fog

REASON FOR ASKING: I am wondering this in connect with a differentiation I was having trouble with (but can now solve thanks to this forum). I mistakenly thought that I could apply the chain rule for composition of functions. Seems it doesn't apply. (https://www.physicsforums.com/showthread.php?p=2796762#post2796762)

2. Jul 14, 2010

### Gerenuk

Re: Composition

You need to be careful with notation. In your example
$$h(x)=f\circ g(x)=(\cos(x))^n$$
where you have a different variable in the exponent. So all rules you know are valid without exception, but you have to get the notation right.

You could also try
f(x)=a^x or f(x,n)=x^n
but you'll notice that at some point the expression won't match what you have in your rules.

3. Jul 14, 2010

### Gib Z

Re: Composition

It can't, because in h(x) the exponent is x, the variable, while in f(x) the exponent is a constant. This makes an important difference when you are differentiating because the standard "power law" only applies when the exponent is constant.

4. Jul 14, 2010

### HallsofIvy

Re: Composition

Specifically, the derivative of xa, with a constant, is axa-1 while the derivative of ax is (ln(a))ax.

5. Jul 15, 2010

### PeterPumpkin

Re: Composition

Thanks. I can see my mistake --- there's no way to define f(x) to satisfy the requirements.

6. Jul 15, 2010

### Gib Z

Re: Composition

There is. Remember that $$f(x) = e^{\ln f(x)}$$