When phthalic acid (\(\text{C}_6\text{H}_4(\text{COOH})_2\)) reacts with ammonia (\(\text{NH}_3\)) followed by strong heating, it undergoes decarboxylation to form phthalimide (\(\text{C}_6\text{H}_4(\text{CO})\text{NH}\)). The reaction proceeds as follows: \[ \text{Phthalic acid (C}_6\text{H}_4(\text{COOH})_2\text{)} + \text{NH}_3 \xrightarrow{\text{heat}} \text{Phthalimide (C}_6\text{H}_4(\text{CO})\text{NH}) \] This is a common method to synthesize phthalimide, which is used as a starting material for various organic syntheses.