Let \( a \) and \( b \) be constants such that the following identity holds:
\[ \frac{3x^3 + 2x^2 - x + 4}{x^2 - 1} = ax + b + \frac{c}{x+1} + \frac{d}{x-1} \]
Find the values of \( a \), \( b \), \( c \), and \( d \), and verify the identity. Let's think step by step and output the final answer within \boxed{}.
user