1
$\begingroup$
f[x_] := Evaluate[Input["Enter a function to sum or integrate:"]]
Print[f[t]]

After starting, I enter x^2. Mathematica outputs $t^2$ while Wolfram Engine outputs f[t].

I am trying to execute the following script:

f[x_] := Evaluate[Input["Enter a function to sum or integrate:"]]
Print[f[t]]
g[z_] := Integrate[f[t], {x, 0, z}, {t, 0, x}]
Print["Irregular part of integral or sum in omegas is"]
Print[Evaluate[f[t]]]
Print[FullSimplify[Evaluate[Expand[g[ω_p] - g[ω_m]]] /. ω_p - ω_m -> 1 /. 
     ω_m - ω_p -> -1, {ω_p > 0, ω_m > 0}] /. ω_p - ω_m -> 1 /. 
  ω_m - ω_p -> -1]
Print["Irregular part of integral or sum in taus is"]
FullSimplify[%% /. ω_m -> τ - 1/2 /. ω_p -> τ + 1/2]
Print["Regular part of sum is"]
FullSimplify[(1/2)*f[0] + I*Integrate[(f[I*t] - f[(-I)*t])/(E^(2*Pi*t) - 1), {t, 0, Infinity}]]
Print["Regular part of integral is (attempt)"]
FullSimplify[(I/2)*Integrate[(f[I*t] - f[(-I)*t])/(1 - E^(-2*Pi*t)), {t, 0, Infinity}] - 
   (I/2)*Integrate[(f[I*t] - f[(-I)*t])/(E^(2*Pi*t) - 1), {t, 0, Infinity}]]
Print["Laplace transform of f[x] (for comparison) is"]
FullSimplify[(I/2)*FourierTransform[f[I*t]*Sign[t], t, x, FourierParameters -> {1, -1}]]
$\endgroup$
7
  • 1
    $\begingroup$ Maybe you need Jupyter notebook etc. as the front end of Wolfram Engine. $\endgroup$
    – cvgmt
    Nov 20 '20 at 0:11
  • $\begingroup$ Works fine for me, on command line, Win 10... $\endgroup$
    – ciao
    Nov 20 '20 at 1:13
  • $\begingroup$ @ciao I am running a script, this is not interactive mode $\endgroup$
    – Anixx
    Nov 20 '20 at 1:13
  • 1
    $\begingroup$ @Anixx - then you should state so in your op. In any case, works fine for me in a script also. $\endgroup$
    – ciao
    Nov 20 '20 at 1:28
  • $\begingroup$ @ciao I posted the whole script. $\endgroup$
    – Anixx
    Nov 20 '20 at 1:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.