0
$\begingroup$

Suppose I define

F1[R + a] = F1[R] + a D[F1[R],R]
F2[R + 2 a] = F2[R] + 2 a D[F2[R],R]

and I want to expand the square of their sum keeping only first order terms in a.

Expand[(F1[R + a] + F2[R + 2 a])^2]
(*=>F1[R]^2 + 2 F1[R] F2[R] + F2[R]^2 + 2 a F1[R] Derivative[1][F1][R] + 
 2 a F2[R] Derivative[1][F1][R] + a^2 Derivative[1][F1][R]^2 + 
 4 a F1[R] Derivative[1][F2][R] + 4 a F2[R] Derivative[1][F2][R] + 
 4 a^2 Derivative[1][F1][R] Derivative[1][F2][R] + 
 4 a^2 Derivative[1][F2][R]^2 *)

Expand doesn't work with Assumptions. How can I expand the above sum and exclude a^2 terms?

I can do Expand[(F1[R + a] + F2[R + 2 a])^2] /. a^2 -> 0 but I don't really like it.

$\endgroup$

1 Answer 1

2
$\begingroup$

Try Series assuming a to be small:

Normal[Series[(F1[R] + a D[F1[R], R] + F2[R] + 2 a D[F2[R],R])^2, {a,0, 1}]]
(*(F1[R] + F2[R])^2 + 2 a (F1[R] + F2[R]) (Derivative[1][F1][R] + 2 Derivative[1][F2][R])*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.