Half of this problem can be solved by using Dt
. Dt
calculates total derivatives, and ratios between total derivatives are derivatives in terms of functions. As a simple example, compare derivation by substitution of Cosh[(a x^2+b)^2]
by (a x^2+b)
:
D[Cosh[u^2], u] /. u -> a x^2 + b
2 (b + a x^2) Sinh[(b + a x^2)^2]
This should be an unsurprising result.
With Dt
, however, this computation can be performed equivalently by:
Dt[Cosh[(a x^2 + b)^2], Constants -> {a, b}]/Dt[a x^2 + b, Constants -> {a, b}]
2 (b + a x^2) Sinh[(b + a x^2)^2]
Simply by changing the bottom ratio, the derivative by Dt[a x, Constants -> {a, b}]
can also be found. That is left as an exercise to the reader.
Unfortunately, for integration, this is rather more difficult. There is no corresponding concept of a "total antiderivative". However, DSolve
can handle some expressions with Dt
, and may be able to help integrate them.
The main limitation with DSolve
in this respect is that it requires the declaration of a dependent and independent variable, and the dependent variable can only depend on the independent variable explicitly. The typical formula for such an integration is something like:
DSolve[g'[x] == Dt[f[a x],Constants->a]/Dt[a x, Constants->a], g, x]
{{g -> Function[{x}, C[1] + f[a x]/a}}
While this example is obviously no different than DSolve[g'[x] == f'[a x], g, x]
, for more complex expressions it can be a simpler way to write the question:
DSolve[g'[x] == Dt[f[a x],Constants->a]/Dt[a x^2, Constants->a], g, x]
{{g -> Function[{x}, C[1] + Integrate[f'[a K[1]]/(2 K[1]), {K[1], 1, x}]}}
Even so, the answer may be more complex than initially anticipated. The K[1]
here is an automatically generated variable created by DSolve
used up in the integration.