I made this op-amp integrator to have sharp edges triangular pulse in out out but this gives me something corrupted. Please help me to resolve my problem. The capacitor is not necessary so we could easily ignore it.
Welcome to ETO!
C2 is very necessary. Without it you don't have an integrator!
U1a is clipping the waveform. Try a smaller amplitude input square-wave.
Things to note about my posted integrator circuit:
1. R1 is absolutely necessary to limit the current into the capacitor. You left it out. This allows use of a much smaller capacitor.
2. U1 requires split supplies.
3. R2/C1 time constant is evident in start-up and the fact that the ramp is not linear.
4. R1/C1 time constant controls the peak amplitude of V(out) and determines if the opamp output runs into its own supply voltages.
5. I modeled a near-ideal, rail-to-rail output opamp; yours may not be that good.
6. Note that it inverts.