# Simplify not working

I am trying to simplify the following expression

code:

Cos[(Sqrt[Integrate[(-1 - I)*dper*Ex[t1], {t1, 0, Infinity}]]*
Sqrt[Integrate[(-1 + I)*dper*Ex[t1], {t1, 0, Infinity}]])/hbar


with previous assumption declared as

\$Assumptions = Element[\[Alpha] | \[Beta] | ap | a0 | E0 | Ep | t | Ex[t1] | Ex[] |
t1 | Nd | T | hbar | dper | dpara, Reals];


However, somehow it seems Mathematica is not able to understand (-1+i)dper does not depend on t1, and therefore, it cannot be simplified. Any thoughts on how I could improve that?

Thanks!

• What is Ex? Should it be Exp? Mar 8, 2021 at 18:49
• Can you, please, include the code shown in the picture as easily copy-&-paste-able text in a code block here? Mar 8, 2021 at 18:55
• The code yo included is not WL. and what is dper? Mar 8, 2021 at 19:31
• To paraphrase the question: Why is Integrate[a*f[x], x] auto-simplified to a*Integrate[f[x], x] but Integrate[a*f[x], {x, x1, x2}] remains as-is without extracting the constant a from the integral? Mar 8, 2021 at 19:36
• @denis - prior to copy and paste of your code, convert it to Raw InputForm Mar 8, 2021 at 19:37

expr = Cos[(Sqrt[Integrate[(-1 - I)*dper*Ex[t1], {t1, 0, Infinity}]]*
Sqrt[Integrate[(-1 + I)*dper*Ex[t1], {t1, 0, Infinity}]])/hbar];


Try this:

expr2 = Simplify[
expr /. Sqrt[Integrate[a_*Ex[t1], {t1, 0, Infinity}]] :>
Sqrt[a]*Sqrt[(Integrate[Ex[t1], {t1, 0, Infinity}])] /.
Sqrt[a_]*Sqrt[b_] :> Sqrt[a*b], dper \[Element] Reals]

(*  Cos[(Sqrt[2] Abs[dper] \!$$\*SubsuperscriptBox[\(\[Integral]$$, $$0$$, $$\[Infinity]$$]$$Ex[ t1] \[DifferentialD]t1$$\))/hbar]  *)


Have fun!