# How do I get the complex conjugate of my interpolation?

I import an interpolation from C++ into mathematica which I then modify. Is there a way to obtain the conjugate of the interpolation? Or do I need to use $$(f g)^* = f^* g^*$$ and export the conjugated interpolation from C++ as well?

Clear[data, f, g, x]
data = {{1, 1 - 1 I}, {2, 3 - 2 I}, {3, 5 - 4 I}, {4, 7 - 8 I}};
f = Interpolation[data] (* this is what I directly export from C++ *)
g = 1/(x - I) f[x] (* some random modifying function *)
Integrate[g[x] Conjugate[g[x]], {x, 01, 4}] (* what I actually want to evaluate in Mathematica *)


This just returns the unevaluated integral. I also tried NIntegrate but that complains about non-numerical values. I assumed this should work, since g[x] can clearly be evaluated and as such, the complex conjugate is trivial.

• Try defining g using ClearAll[g]; g[x_] := 1/(x - I) f[x]. I would also switch from Integrate to NIntegrate to calculate your integral. Jun 25 at 8:57

Clear[data, f, g, x] 