Change variables and expand around new variable (Mathematica)

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 3K views
ramparts
Messages
44
Reaction score
0
I have a differential expression that I want to expand to some order around infinity (it's for calculating weak-field limits in GR). I have two functions, B(r) and n(r), and some expression involving them along the lines of

n[r] (3 r B'[r]^2 - 4 B[r] (2 B'[r] + r B''[r]))

Basically I want to change variables to x=1/r and expand this expression around x=0 to, say, 5th order. This seems like it would be fairly simple, but I must be doing something wrong because Mathematica keeps giving me errors like

General::ivar: "1/r is not a valid variable."

I've tried several ways of doing this, but I'm still learning Mathematica so I'd appreciate having the right way pointed out! Thanks.

(I've also tried expanding around {r,Infinity,5} and just gotten a symbolic result which wasn't useful.)
 
Physics news on Phys.org
I think the problem boils down to this: given a differential expression (like the one I posted) I don't know how, in Mathematica, to change variables and have Mathematica do all the chain rule through. I've since learned that Maple can do this (and indeed I've been using Maple for what I need to do) with its dchange function in the PDETools. I wonder how one can get the same functionality within Mathematica.