We usually say "With the aim of". "With the aim to" sounds unnatural in most contexts.
We usually say "With the aim of". "With the aim to" sounds unnatural in most contexts.
With the aim of improving the metabolic profile of her patients, the doctor used a new treatment.
With the aim to improve the metabolic profile of her patients, the doctor used a new treatment.
Instead of using "with the aim of", however, you can rephrase your sentence to introduce "to + infinitive".
The aim of the new treatment is to improve the metabolic profile of her patients.
We'll add here that the compound preposition "with the aim of" is somewhat formal.
The country deliberately interfered in Canada’s internal affairs with the aim of serving its own geopolitical interest.