I'm interested in using Mathematica's symbolic manipulation to obtain, for a particular function $f$, derivatives of arbitrary order evaluated at zero. Normally I'd use the D command, but $f$ depends on a function $h$ that I can only define implicitly. More precisely, given a constant $a$ and two functions $g$ and $R$, I'd like to calculate $f^{(n)}(0)$ for any given $n$, where
$f(s) := g(a+ h(s)) \, h'(s)$
and $h$ is a function satisfying $h(0) = 0$ and $R(a+h(s))=-s$ for all $s$.
On paper I can of course use implicit differentiation on the last equation and substitute accordingly to obtain the derivatives of $f$ that I'd like in terms of those of $g$ and $R$, but this is eventually quite tedious, so I was looking to automate it. Is there a way to accomplish this in Mathematica?
I've written some pseudocode for a particular example, with the part I'm stuck on denoted by ???. Ideally, I'd like the code defining $h(s)$ to be independent of the particular choice of $a$, $g$ and $R$ so that I don't have to rewrite it if I change the former. Help is greatly appreciated!
(* Example definitions of a, n, g, and R *)
a = 1;
n = 5;
g[s_] := Exp[-s];
R[s_] := Log[s]-s+1;
(* Implicit definition of h[s_] goes here *)
???
(* Define f, take nth derivative, evaluate at 0 *)
f[s_] := g[a + h[s]] h'[s];
D[f[s], {s, n}]/.s->0
Edit: example R was poorly chosen, sorry!
Dt[]is useful if you want to do implicit differentiation. – J. M.'s missing motivation Jun 30 '15 at 00:28Dabove byDt, I get closer to what I'd like with the various derivatives ofhappearing in the output, but can I also get Mathematica to compute those too from an implicit definition? – sourisse Jun 30 '15 at 00:44Solve[]afterwards if need be. – J. M.'s missing motivation Jun 30 '15 at 00:50