2
$\begingroup$

My input:

FullSimplify[Integrate[b1[k], {k, 0, x}] + Integrate[-b1[k], {k, 0, x}]]

computes to:

enter image description here

But I would expect: 0

Do I have to make some assumptions in order to get this to work?

Thanks!

$\endgroup$
1
  • $\begingroup$ Note that it is not "always" even correct. Common example: In[293]:= b1[k_] := k*RandomInteger[{0, 100}]In[293]:= b1[k_] := k*RandomInteger[{0, 100}] Integrate[b1[k], {k, 0, x}] + Integrate[-b1[k], {k, 0, x}] Out[294]= -11 x^2 Integrate[b1[k], {k, 0, x}] + Integrate[-b1[k], {k, 0, x}] Out[294]= -11 x^2 $\endgroup$ Commented Jul 19, 2017 at 22:54

1 Answer 1

2
$\begingroup$

I don't know why FullSimplify does not employ the sum rule for this but as a workaround, you could implement your own TransformationFunction:

IntSumTransformFunction[expr_]:=expr/.((Integrate[leftArg1_,rightArg_]+Integrate[leftArg2_,rightArg_]):>Integrate[leftArg1+leftArg2,rightArg])
FullSimplify[Integrate[b1[k],{k,0,x}]+Integrate[-b1[k],{k,0,x}],TransformationFunctions->IntSumTransformFunction]

0

It can even handle "more complicated" cases:

FullSimplify[Integrate[2*b1[k],{k,0,x}]+Integrate[-b1[k],{k,0,x}],TransformationFunctions->IntSumTransFormFunction]

Integrate[b1[k],{k,0,x}]

$\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.