2
$\begingroup$

I am trying to calculate the integral of an symbolic function f[x] and want it to be symbolically $\int f(x) dx = F[x]$. I tried defining it implicitly via

F'[x_] = f[x];

This works fine in one direction as

D[F[b], b]

gives

f[b].

However, the otherway round doesn't work as the input Integrate[f[b], b] translates to $\int f(x) dx$ instead of F[b].

I also tried defining Integrate[f[x],x]=F[x], but this is protected.

Do you have any suggestions on how to get this working? I couldn't find anything in the documentation - I'm happy for hints in case I missed something.

Thanks a lot in advance.

$\endgroup$
3
  • $\begingroup$ Integrate[f'[x], x]? $\endgroup$
    – march
    Commented Nov 28, 2017 at 17:35
  • $\begingroup$ @march Thanks for your comment. I'm not sure how this helps. The goals is not to arrive at the output f[x] by any means but to have Input Integrate[f[x],x], Output F[x]. Could you maybe clarify what you mean by your suggestion? $\endgroup$
    – MathProb
    Commented Nov 28, 2017 at 18:24
  • $\begingroup$ what do you mean by saying "I am trying to calculate the integral of an symbolic function"? do you intend to write eg a function that calculates the integrals of its inputs? $\endgroup$
    – user42582
    Commented Nov 28, 2017 at 18:39

1 Answer 1

1
$\begingroup$

Here is what you probably want. Associate UpValues with the symbols f and F as follows:

ClearAll[f, F]
f /: Integrate[f[x_], x_] := F[x]
F /: D[F[x_], x_] := f[x]

Then,

Integrate[f[t], t]
D[F[t], t]
(* F[t] *)
(* f[t] *)
$\endgroup$
1
  • $\begingroup$ Works fine for my purpose, but note that Integrate[a*f[x],x] does not give aF[x]. Altering the expression even by simple multiplication messes everything up. $\endgroup$
    – MathProb
    Commented Nov 30, 2017 at 9:21

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.