I am very new to Mathematica, and I searched the documentation and google now for quite some time.
Let's say, I want to implement a mathematica function, that does the following mapping: $f(t)\mapsto \int_0^t f(s)\ \mathrm{d}s+f'(t)$. ($f$ is assumed to be differentiable and integrable.)
Edit: It should also work for $\mathbb{R}\longrightarrow\mathbb{R}^n$ functions.
How would you do that? It should be a function like
IntAndDiff[f_]=Integrate[f,{s,0,t}]+D[f,t]
which does of course not work. How am I able to "access" the variable of $f$ in this case, so that I can define the integration and differentiation accordingly?
Edit: I also want this function to behave like an operator, so the output should be a $\mathbb{R}\longrightarrow\mathbb{R}^n$ function again. I.e. I want to be able to apply this (and other such operators) on the result again...
ClearAll[IntAndDiff];IntAndDiff[f_] = Integrate[f@s, {s, 0, t}] + D[f@t, t]
? $\endgroup$SetDelayed
, i.e.,IntAndDiff[f_] := Integrate[f[s], {s, 0, t}] + D[f[t], t]
Examples:IntAndDiff /@ {Sin, Sin[#] &, Cos, Cos[#] &, Sqrt, Sqrt[#] &, #^2 + 2 # - 3 &}
$\endgroup$