# Second derivatives in Latexify

**URL:** https://discourse.julialang.org/t/second-derivatives-in-latexify/134140
**Category:** General Usage
**Tags:** latex, symbolics, latexify
**Created:** [November 26, 2025, 12:10pm UTC](https://discourse.julialang.org/t/second-derivatives-in-latexify/134140 "2025-11-26T12:10:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![omerc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/omerc/32/219287_2.png) [@omerc](https://discourse.julialang.org/u/omerc)
#### Post date: [November 26, 2025, 12:10pm UTC](https://discourse.julialang.org/t/second-derivatives-in-latexify/134140/1 "2025-11-26T12:10:25Z")

</div>

Hi,  
I’m using the Symbolics package to generate a partial differential equation, and then Latexify to turn that into a Latex string for use in a manuscript that I’m writing.  
Essentially, I’m trying to write down the Laplacian of some function:

```julia-auto
using Symbolics, Latexify, SymbolicUtils
@variables x[1:4]
@variables f(x...)
laplacian = sum(Symbolics.derivative.(Symbolics.gradient(f, [x...]), [x...]))

```

which seems to correctly produce the sum of second derivatives:

> Differential(x[3], 2)(f(x[1], x[2], x[3], x[4])) + Differential(x[4], 2)(f(x[1], x[2], x[3], x[4])) + Differential(x[1], 2)(f(x[1], x[2], x[3], x[4])) + Differential(x[2], 2)(f(x[1], x[2], x[3], x[4]))

However, when using Latexify to create a Latex representation of this expression,

```julia-auto
println(latexify(laplacian, env=:inline))

```

the result is  
\frac{\mathrm{d}}{x\_{3}} f\left( x\_{1}, x\_{2}, x\_{3}, x\_{4} \right) + \frac{\mathrm{d}}{x\_{4}} f\left( x\_{1}, x\_{2}, x\_{3}, x\_{4} \right) + \frac{\mathrm{d}}{x\_{1}} f\left( x\_{1}, x\_{2}, x\_{3}, x\_{4} \right) + \frac{\mathrm{d}}{x\_{2}} f\left( x\_{1}, x\_{2}, x\_{3}, x\_{4} \right)  
without indicating that the derivatives are second order, as in _Differential(x[i], 2)_.  
Also, the denominators are missing the “d” of the differentials.

Am I misusing any of the functions here, or is this a bug/missing feature? And is there an easy workaround/solution to this?

Thanks in advance!
