Math Idea – Internally Dependent Functions – Use Python Programming And Sympy

I kind of figured out how to use sympy in python to test math ideas.

First copy the initial imports from sympy interactive tutorial.

Then the syntax and what you can do a mix of ordinary python with numpy coding and sympy.

So defining a function is done with

def function(x):

some code with x

return f

An example would be to find an other approximate function for exp(-x**2).

In the example I tried to adapt sin(x)/x to exp(-x**2). It could be ?solved with ordinary machine learning methods.

def g(x,k=1):

a = sin(x*k)/(x*k)

y = a**15

b = y*sin(x*k)/(x*k)

return b

Here I tought I adapt the function internally. That is. I multiply the original function with a function of itself. The y = a**15.

Then I just ran g(x,k) through the loop to find k with the loss of loss = F.mean_squared_error(g(x,k), exp(-x**2))

From this I recomend that you can use pretty much your entire imagination to find the value you want. Its much more fun that way.