TransWikia.com

How to write equation as shown in picture using Latex?

TeX - LaTeX Asked by faisal shahzad on August 28, 2020

enter image description here

how we write this equation in latex in given form

6 Answers

Here you go:

documentclass[10pt,a4paper]{article}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{graphicx}
begin{document}
    $ufrac{partial u}{partial x}+vfrac{partial u}{partial y}+wfrac{partial u}{partial z}+lambda_1begin{pmatrix}
    u^2frac{partial^2 u}{partial x^2}+vfrac{partial^2 u}{partial y^2}+w^2frac{partial^2 u}{partial z^2}+2uvfrac{partial^2 u}{partial xpartial y}+2vwfrac{partial^2 u}{partial ypartial z}+2uwfrac{partial^2 u}{partial xpartial z}
    end{pmatrix} = vfrac{partial^2 u}{partial z^2},$
end{document}

this will give you:

enter image description here

PS: Welcome to TeX.se, from next time, please provide a MWE.

Answered by Raaja_is_at_topanswers.xyz on August 28, 2020

Here is a start:

documentclass[]{article}
usepackage{amsmath}

begin{document}
begin{equation}
    ufrac{partial u}{partial x}+...
    +lambda_1 
    begin{pmatrix}
    u^2 frac{partial^2 u}{partial x^2}+...
    + 2 uv frac{partial^2 u}{partial x partial y}+...
    end{pmatrix} = v frac{partial^2 u}{partial z^2}
end{equation}
end{document}

enter image description here

Answered by Hafid Boukhoulda on August 28, 2020

Borrow a little from all answer and make a little change (such as change v to nu in the right-hand side)

documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation}
    ufrac{partial u}{partial x}+vfrac{partial u}{partial y}+wfrac{partial u}{partial z}+lambda_1begin{pmatrix}
    u^2frac{partial^2 u}{partial x^2}+vfrac{partial^2 u}{partial y^2}+w^2frac{partial^2 u}{partial z^2}+2uvfrac{partial^2 u}{partial xpartial y}+2vwfrac{partial^2 u}{partial ypartial z}+2uwfrac{partial^2 u}{partial xpartial z}
    end{pmatrix} = nufrac{partial^2 u}{partial z^2},
    tag{1.25}
end{equation}
end{document}

Answered by user156344 on August 28, 2020

A variation on the theme, but with a greater emphasis on simplifying the input:

documentclass{article}
usepackage{amsmath}
usepackage{xparse}

newcommand{pdiff}{mathop{}!partial}

ExplSyntaxOn
NewDocumentCommand{pder}{omm}
 {
  frac{pdiffIfValueT{#1}{^{#1}}#2}{faisal_pder_vars:n { #3 }}
 }
cs_new_protected:Nn faisal_pder_vars:n
 {
  clist_map_inline:nn { #1 } { pdiff##1 }
 }
ExplSyntaxOff


begin{document}

begin{equation}
upder{u}{x}+vpder{u}{y}+wpder{u}{z}+
  lambda_1
  left(begin{gathered}
    u^2pder[2]{u}{x^2}+vpder[2]{u}{y^2}+w^2pder[2]{u}{z^2}
    mspace{-medmuskip}{}
    +2uvpder[2]{u}{x,y}+2vwpder[2]{u}{y,z}+2uwpder[2]{u}{x,z}
    end{gathered}right)
= nupder[2]{u}{z^2},
end{equation}

begin{equation}
begin{split}
upder{u}{x}&+vpder{u}{y}+wpder{u}{z}
+lambda_1biggl(
    u^2pder[2]{u}{x^2}+vpder[2]{u}{y^2}+w^2pder[2]{u}{z^2}

&+2uvpder[2]{u}{x,y}+2vwpder[2]{u}{y,z}+2uwpder[2]{u}{x,z}biggr)
= nupder[2]{u}{z^2},
end{split}
end{equation}

end{document}

The syntax for pder is

  1. optional argument for the order of the derivative (if greater than 1)
  2. function to differentiate
  3. list of the variables the derivative is taken with respect to, comma separated

In the first case I used mspace{-medmuskip}{}+ in order to have the plus sign correctly spaced. I used gathered instead of pmatrix because it is semantically sounder.

enter image description here

Answered by egreg on August 28, 2020

With a few shortcut macros it's much easier:

plain TeX version:

let~catcode~`86~`j0~`X13~`C1~`D2~`M3jdefX81C~`8113jdefDXZZ81C~
`8113DXYY81CZ81jletDYLLjletYFFjfiYNNjdefYPPjpartialZIZAZBZj{Zj}Y
EEjexpandafterYOOjelseYKKjifxNI818283CL}81NAC82DNBC83Djfuturelet
jTjHDNjHCKjT}L{AOL{BF{DXUUCI)jpCjp)CDDDY VVjoverNjp)818283CKX81X
CP82VP83DOCP^C81D82VjbC81DC83DDFDYRRjrelaxNjb8182Cjd8182RDNjd81%
8283CK83RP82^C81DOP82P83FDY!!uY@@vY##wY$$xYj%%yY&&zXvv81C81^2DMM
!U!$+@U!%+#U!&+jlambda_1jleft(v!U)2! $+v@U)2!%+v#U)2!&jatop+2!@U
)2!C$%D+2@#U)2!C%&D+2!#U)2!C$&Djright)=jnuU)2!&jeqno(1.25)MMjbye

LaTeX version:

documentclass{article}begin{document}
let~catcode~`86~`j0~`X13~`C1~`D2~`M3jdefX81C~`8113jdefDXZZ81C~
`8113DXYY81CZ81jletDYLLjletYFFjfiYNNjdefYPPjpartialZIZAZBZj{Zj}Y
EEjexpandafterYOOjelseYKKjifxNI818283CL}81NAC82DNBC83Djfuturelet
jTjHDNjHCKjT}L{AOL{BF{DXUUCI)jpCjp)CDDDY VVjoverNjp)818283CKX81X
CP82VP83DOCP^C81D82VjbC81DC83DDFDYRRjrelaxNjb8182Cjd8182RDNjd81%
8283CK83RP82^C81DOP82P83FDY!!uY@@vY##wY$$xYj%%yY&&zXvv81C81^2DMM
!U!$+@U!%+#U!&+jlambda_1jleft(v!U)2!$+v@U)2!%+v#U)2!&jatop+2!@U)
2!C$%D+2@#U)2!C%&D+2!#U)2!C$&Djright)=jnuU)2!&jeqno(1.25)MMjstop

output:

enter image description here


Inspired by David Carlisle's xii :)

Answered by Phelype Oleinik on August 28, 2020

$$u frac{partial u}{partial x}+v frac{partial u}{partial y}+w frac{partial u}{partial z}+lambda_{1}left(begin{array}{c}
u^{2} frac{partial^{2} u}{partial x^{2}}+v^{2} frac{partial^{2} u}{partial y^{2}}+w^{2} frac{partial^{2} u}{partial z^{2}} 
+2 u v frac{partial^{2} u}{partial x partial y}+2 v w frac{partial^{2} u}{partial partial partial z}+2 u w frac{partial^{2} u}{partial x partial z}
end{array}right)=nu frac{partial^{2} u}{partial z^{2}}$$

Answered by mamman on August 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP