In theory, yes, a neural network can approximate ( y = \sin(x) ) to arbitrary accuracy without using any explicit trigonometric functions. But whether it can perfectly model it — in the strict mathematical sense — is more nuanced.
Let's break this down.
🔹 1. Universal Approximation Theorem
According to the universal approximation theorem, a feedforward neural network with at least one hidden layer containing a finite number of neurons and a nonlinear activation function (e.g., ReLU, sigmoid, tanh) can approximate any continuous function on a compact interval to any desired degree of accuracy, including ( \sin(x) ).
So yes, a neural network can approximate ( \sin(x) ) on any finite interval arbitrarily well, without using sine directly.
🔹 2. Perfect Modeling vs Approximation
- ✅ Approximation: Yes, within some error tolerance ( \epsilon ), we can approximate ( \sin(x) ) arbitrarily closely.
- ❌ Perfect Modeling: If by perfect you mean exact match for all real values of ( x ) (i.e. over the whole (\mathbb{R})), then no, a finite standard neural network cannot perfectly represent ( \sin(x) ) over all of ( \mathbb{R} ).
Why?
- ( \sin(x) ) is a non-polynomial periodic function, and standard feedforward networks with finite depth and width do not exactly represent such functions.
- Infinite precision, infinite depth, or using special/specific function approximations would be required to achieve a true perfect match for all ( x ).
🔹 3. Common Approaches / Tricks
Even without trigonometric functions, neural networks can approximate ( \sin(x) ) through its properties:
- Fourier series (sum of sinusoids, which could be learned).
- Taylor series expansion (approximate sine locally with polynomials).
- Learn it directly using data, i.e., train the network on ( x ) and ( \sin(x) ) values.
🔹 4. Activation Functions Matter
Certain periodic activations (like sine itself in a SIREN network) make this easier:
- The SIREN architecture (Sitzmann et al., 2020) uses sin as activation and models complex periodic functions very effectively.
- But if you restrict to common activations like ReLU or sigmoid, more layers or neurons are needed to approximate sine well.
✅ Short Answer
Yes — a neural network with standard nonlinear activations (like ReLU, sigmoid, etc.) can approximate
[ y = \sin(x) ]
to arbitrary precision on a finite interval, without using any built-in trigonometric functions.
BUT, it cannot perfectly model it over all real numbers unless:
- It uses sine directly (as an activation or operation), or
- It has infinite capacity (not feasible in practice).
Would you like to see an example of a neural network approximating ( \sin(x) ) in code (e.g., using PyTorch or TensorFlow)?